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