在npm发布自己包的时提示[FORBIDDEN] Public registration is not allowed

发布时间 2023-09-28 09:03:30作者: 月豕

问题描述

在发布自己的包时提示

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmmirror.com/-/user/org.couchdb.user:****** - [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!     D:\NodeJS\node_cache\_logs\2023-09-28T00_28_36_337Z-debug-0.log

原因分析

你的npm使用了镜像地址

解决方法

  1. 全局安装nrm,也就是node的源管理器
npm i -g nrm
  1. 修改镜像
nrm use npm

要改回淘宝镜像就

nrm use taobao