npm publish发布包出现403错误
程序员文章站
2022-05-31 20:18:46
...
描述
发布包过程可能会遇到很多问题,比较无语的是403 Forbidden如下
npm ERR! 403 403 Forbidden - PUT http://registry.npmjs.org/hello_test_npm - You do not have permission to publish "hello_test_npm". Are you logged in as the correct user?
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.
看提示好像是权限或登录问题,但在npm login和npm whoami都正确的情况下还是报一样的错误。后来猜测是hello_test_npm被别人发布过了吧,所以修改package.json文件中的name。
解决
把name改成hello_test_npm_something_else就成功了。
上一篇: 使用 cnpm 加速 npm
下一篇: Gitbook 安装与配置