npm上传私有源报错:Unable to authenticate, need: BASIC realm=”Sonatype Nexus Repository Manager”Sonatype Nexus Repository Manager

故障描述:换了一台电脑后npm publish报错:“Unable to authenticate, need: BASIC realm=”Sonatype Nexus Repository Manager””

解决方法:清空C:\Users\think\.npmrc

然后执行:

npm adduser  --registry=http://nexus.mirror.xxx.com.cn/repository/npm-hosted/

重新上传:

npm adduser