Npm发布包时,报错的解决记录

执行

npm publish

开始报错了

npm ERR! publish Failed PUT 401

npm ERR! code E401

npm ERR! 404 unauthorized Login first: zhubangbang

npm ERR! 404

npm ERR! 404  ‘zhubangbang’ is not in the npm registry.

npm ERR! 404 You should bug the author to publish it (or use the name yourself!)

npm ERR! 404

npm ERR! 404 Note that you can also install from a

npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:

解决:通过安装nrm

npm install -g nrm

从淘宝源切到npm源;

再次执行发布;报错了

npm ERR! code ENEEDAUTH

npm ERR! need auth auth required for publishing

npm ERR! need auth You need to authorize this machine using `npm adduser`

执行npm adduser

Username: zhubangbang

Password:

Email: (this IS public) 79****07@qq.com

Logged in as zhubangbang on https://registry.npmjs.org/.

再次知性

npm publish

这样就发布成功了,

发布成功后,会收到npm官方给的一个邮件

~~~~~

未经允许不得转载:朱邦邦的博客 » Npm发布包时,报错的解决记录

赞 (0)

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址