npm login 时报错npm ERR! code E403

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmmirror.com/-/user/org.couchdb.user:jieyucx - [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使用了镜像地址.

解放方案

  1. 全局安装也就是node的源管理器
npm install -g nrm
  1. 使用 nrm ls 查看当前源
nrm ls

在这里插入图片描述
3. 切换到npm官方的源地址

nrm use npm

在这里插入图片描述

记得每次npm publish的时候也都要切换回来.正常安装包的时候可以
nrm use taobao切换到淘宝镜像源

靠!!!
我切了他又报401,真服了啊,明明已经切到npm源地址了
在这里插入图片描述
可以使用npm config get registry查看当前的源

npm config get registry

如果是npm源地址,我们关掉终端,重启一下,再次登录试试。

猜你喜欢

转载自blog.csdn.net/jieyucx/article/details/131900731
今日推荐