npm ERR! 404 Not Found - Scope not found


同步鏈接: https://www.shanejix.com/posts/npm ERR! 404 Not Found - Scope not found/

執行 npm publish 時報錯

npm notice
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@xxx%2fxxx - Scope not found
npm ERR! 404
npm ERR! 404  '@xxx/xxx@0.0.0' is not in this 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:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-12-06T14_56_55_018Z-debug.log

如果要使用名稱 @scope/package 在 NPM 上發布包,則需要確保 Namespace @scope 在 NPM 上存在。需要創建該命名空間,需要使用 @scope 名稱在 NPM 上創建組織

創建該組織后,加入組織並登錄

npm login

登錄成功后,發布名為 @scope/firstpackage 的包

npm publish --access public

或者,在package.json 中寫入

  "publishConfig": {
    "access": "public"
  },

然后執行

npm publish

未設置 publishConfigaccess會報 npm ERR! 402 Payment Required 錯誤如下:

npm notice
npm ERR! code E402
npm ERR! 402 Payment Required - PUT https://registry.npmjs.org/@xxx%2fxxx - You must sign up
for private packages

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-12-06T15_00_50_580Z-debug.log

references

作者:shanejix
出處:https://www.shanejix.com/posts/npm ERR! 404 Not Found - Scope not found/
版權:本作品采用「署名-非商業性使用-相同方式共享 4.0 國際」許可協議進行許可。
聲明:轉載請注明出處!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM