Unable to authenticate, need: BASIC realm=“Sonatype Nexus Repository Manager“ 问题解决

使用的是nexus搭建的npm私服,项目.npmrc配置如下

registry=https://xxx.com/repository/npm-group/

执行 npm login 或 npm install 时会报如下错误:

npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"

项目同样的配置,其他windows或者mac电脑上,均无该问题。这里怀疑只有在当前操作系统版本会出先问题。

解决方案:

去掉仓库地址最后的一个斜杠,就可以正常使用

registry=https://xxx.com/repository/npm-group

猜你喜欢

转载自blog.csdn.net/weixin_43550562/article/details/131063972