npm login登录失败. code E409。Enter one-time password
文章目录
npm ERR! code E409
npm ERR! 409 Conflict - PUT https://registry.npmmirror.com/-/user/org.couchdb.user:xxx - [conflict] User xxx already exists
npm ERR! A complete log of this run can be found in:失败原因
可以看到PUT的地址并不是registry.npmjs.org,而是 npmmirror。
解决方法
终端输入
npm config set registry https://registry.npmjs.org
如图:

最后一步又出来了一个 Enter one-time password from your authenticator app,意思是需要使用authenticator校验。
添加2FA
登录npmjs.com点击个人账号

在配置文件设置页面上的“双因素身份验证”下,单击启用 2FA。

在 2FA 设置页面上,选择您要启用的模式。

最后扫描网页的二维码添加到你的 Authenticator中。
千万不要忘了滚动网页,底部还要输入6位code验证。
验证成功后,在终端npm login 里就可以登录啦。
参考文章: https://docs.npmjs.com/config...。配置两步验证
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论