npm publish踩坑

问题一:

npm ERR! 403 403 Forbidden - PUT http://registry.npmjs.org/nodestudy - You do not have permission to publish "nodestudy". 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 ERR! A complete log of this run can be found in:
npm ERR! C:\soft\develop\nodejs\node_cache\_logs\2020-03-20T06_59_39_920Z-debug.log
View Code

原因:module名在npm上已经被占用
解决方案:把package.json里的name修改过来

问题二:

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT http://registry.npmjs.org/wuyulongtest - you must verify your email before publishing a new package: https://www.npmjs.com/email-edit
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 ERR! A complete log of this run can be found in:
npm ERR! C:\soft\develop\nodejs\node_cache\_logs\2020-03-20T07_02_16_473Z-debug.log
View Code

原因:npm注册后未验证邮箱
解决方案:浏览器访问https://www.npmjs.com/email-edit,点击Do you need us send it again?,注意如果手机验证报错:service unavailable,
电脑登录验证

posted @ 2020-04-26 16:33  wuyulong  阅读(966)  评论(0)    收藏  举报