如何创build一个在npm 3.x,4.x,5.x和yarn上工作的npmrc

我正在configuration一个jenkins节点来构build我所有的node.js应用程序,并且公司有很多使用各种节点/ npm版本的node.js应用程序。 我试图configuration一个适用于npm> = 3.x和yarn的~/.npmrc

下面的~/.npmrcnpm 3.x / 4.x或者yarnnpm

 registry=http://nexus.my.domain/repository/npm-all-group/ always-auth=true email=my@domain.email _auth="Base64Of(login:password)" strict-ssl=false 

下面的~/.npmrc只适用于npm 5.x

 //nexus.my.domain/repository/npm-all-group/:_authToken=secrete-token-create-using-login-and-password 

如果我join展位,我总是得到错误:

 npm ERR! code E401 npm ERR! 401 Unauthorized: coffee-script@1.7.1 

是否可以创build适用于所有版本的~/.npmrc文件? 我使用sonatype nexus 3.3.2作为npm服务器。