[處理]npm ERR! publish Failed PUT 403

運用敕令 npm publish 宣布一個包時,或有以下報錯:

...
npm ERR! publish Failed PUT 403
npm ERR! code E403
npm ERR! no_perms Private mode enable, only admin can publish this module:...
...

處理歷程以下:

1. 搜檢堆棧是不是被設成了淘寶鏡像庫
npm config get registry

https://registry.npm.taobao.org/

2. 如是,則設回原堆棧
npm config set registry=http://registry.npmjs.org
3. 登錄賬號(如未登錄)
npm login

Username: username

Password:
*

Email: (this IS public)

foo@bar.com Logged in as username on
http://registry.npmjs.org/.

4. 再次宣布
npm publish
5. 如宣布勝利,則再次將堆棧地點設為淘寶鏡像地點
npm config set registry=https://registry.npm.taobao.org/
    原文作者:aeiou
    原文地址: https://segmentfault.com/a/1190000014800794
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞