npm login 或者 npm adduser 之后 遇见 Public registration is not allowed

3,355 阅读1分钟

Public registration is not allowed

npm login 或者 npm adduser 之后 遇见 Public registration is not allowed

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT {url}:username - [FORBIDDEN] Public registration is not allowed
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/******/.npm/_logs/{time}-debug-0.log

其实是因为npm镜像地址有问题 使用下方指令 将镜像切回即可正确完成登录操作

npm config set registry https://registry.npmjs.org/