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
未设置 publishConfig的access会报 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

浙公网安备 33010602011771号