NodeJS 404发布npm包时出现错误-“npm ERR!404未找到- PUT https://registry.npmjs.org/”

nxowjjhe  于 2023-01-12  发布在  Node.js
关注(0)|答案(3)|浏览(127)

npm发布时,抛出以下错误。以前曾运行过。

npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@XYZ - Not found
npm ERR! 404
npm ERR! 404  '@XYZ@5.0.0' 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:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-11-11T06_46_42_252Z-debug.log
twh00eeo

twh00eeo1#

运行npm login命令

E:\XYZ>npm login
Username: XXXXX
Password:
Email: (this IS public) myemail id
Logged in as XXXXXon https://registry.npmjs.org/.

然后再次发布

fnx2tebb

fnx2tebb2#

我通过将注册表从https://registry.npmjs.org更改为https://registry.npmjs.org/来解决这个问题,行的末尾有一个额外的斜线。

ars1skjm

ars1skjm3#

在我的例子中,在检查我是通过npm whoami登录的之后,我需要被添加到拥有我想要发布打包的repo的组织中。

相关问题