Press "Enter" to skip to content

nexus部署之后,npm包publish 报401问题。

我这边用容器部署了nexus之后,尝试部署maven包没问题。

配置了npm的repository之后,尝试本地发布npm包之后报错。

npm ERR! publish Failed PUT 401
npm ERR! code E401
npm ERR! 404 401 Unauthorized

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/caizhongzhen/.npm/_logs/2020-04-17T06_11_40_969Z-debug.log

各种尝试,各种登录配置,还是不行。

尝试登录
npm adduser --registry=https://repo.mynexus.com/repository/npm-releases/

显示登录成功,还是不行。

尝试部署包
npm publish --registry https://repo.mynexus.com/repository/npm-releases/

还是报错。

各种查资料,发现一个配置项需要勾选

需要将 这个 realms里面的 npm bearer token realm 激活一下。

验证,完美解决问题。

参考资料:https://stackoverflow.com/questions/39460074/unable-to-publish-to-an-npm-registry-local

One Comment

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注