在npm发布自己包的时提示[FORBIDDEN] Public registration is not allowed
问题描述
在发布自己的包时提示
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使用了镜像地址
解决方法
- 全局安装nrm,也就是node的源管理器
npm i -g nrm
- 修改镜像
nrm use npm
要改回淘宝镜像就
nrm use taobao
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步