npm 错误 E401:无法进行身份验证,需要:BASIC 领域 =“Sonatype Nexus Repository Manager" [英] npm error E401: Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"

查看:886
本文介绍了npm 错误 E401:无法进行身份验证,需要:BASIC 领域 =“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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆