' npm login '出现' E404 '错误



我正在尝试登录到NPM注册表,但它失败了HTTP 404错误:

$ npm adduser --registry=https://<forge>/artifactory/api/npm/<repo>
Username: <user>
Password:
Email: (this IS public) <user>@<company>.com
npm ERR! code E404
npm ERR! 404 Registry returned 404 for PUT on https://<forge>/artifactory/api/npm/-/user/org.couchdb.user:<user>
npm ERR! 404
npm ERR! 404  'org.couchdb.user:<user>' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404  1. name can only contain URL-friendly characters
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!     /home/jenkins/.npm/_logs/2021-09-10T09_59_55_596Z-debug.log

有什么问题吗?

我通过在注册表URL的末尾添加斜杠来解决这个问题,不知道为什么NPM在这方面看起来非常细致:

$ npm adduser --registry=https://<forge>/artifactory/api/npm/<registry>/
Username: <user>
Password:
Email: (this IS public) <user>@<company>.com
Logged in as <user> on https://<forge>/artifactory/api/npm/<registry>/.

最新更新