npm 错误 E401:无法进行身份验证,需要:BASIC 领域 =“Sonatype Nexus Repository Manager" [英] npm error E401: Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
问题描述
我将 node 版本升级到 12.16.2,将 npm 版本升级到 6.14.4.之后我无法运行 npm install
,因为我收到此错误
I upgraded node version to 12.16.2 and npm version to 6.14.4. After that I am not able to run npm install
, as I'm getting this error
code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
我什至尝试删除 node_modules 和 package-lock.json 并再次运行 npm install,但没有任何改变.
I even tried deleting node_modules and package-lock.json and running npm install again, but doesn't change anything.
推荐答案
我遇到了类似的问题.我通过将 _auth 添加到我的 ~/.npmrc 中解决了它.请参阅文档如何对您的联系凭证进行编码.我使用npm config set _auth xxx"添加了编码凭据.
I had similar issue. I resolved it by adding _auth into my ~/.npmrc. See the doc how to encode your nexus credential. I added the encoded credential using "npm config set _auth xxx".
您将无法使用npm config list"查看该值;或npm config get _auth".
You wont be able to see the value using "npm config list" or "npm config get _auth".
这篇关于npm 错误 E401:无法进行身份验证,需要:BASIC 领域 =“Sonatype Nexus Repository Manager"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!