Cli: npm 发布 404 Not Found - PUT

创建于 2020-08-07  ·  3评论  ·  资料来源: npm/cli

最近的问题是#1626,但它是关于使用 npm 来获取包的,对于大多数用户来说,它看起来已经解决了。
这里是关于CI中npm发布包的问题,​​暂时没有解决。

当前行为:

https://framagit.org/1000i100/g1lien/-/jobs/1072053

$ npm publish
[...]
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/g1link - Not found
npm ERR! 404 
npm ERR! 404  '[email protected]' 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_token 身份验证在 gitlab-CI 中从 docker 成功发布我的包。
(它昨天在我的笔记本电脑上使用 npm login 运行,但不适用于 CI 中的 npm_token)。

重现步骤:

前任。 重现行为的步骤:

  1. 分叉这个: https :
  2. 更改包名称并添加您的 npm 令牌
  3. 在 CI 活动的 gitlab 上用标签推送它。

它应该重现该问题。

环境:

https://framagit.org/1000i100/g1lien/-/blob/master/.gitlab-ci.yml#L5
https://framagit.org/1000i100/g1lien/-/jobs/1072052#L17

  • 操作系统:gitlab 中的 Docker 图像: node:current
  • 节点:v14.7.0
  • NPM:6.14.7

最有用的评论

我试图从一台新机器上npm publish并得到同样意外的 404。在我的情况下,它是由npm login 。 我知道 401 可能会“泄漏”私有包的存在,但我认为 CLI 会首先检查我是否先通过身份验证并以更合适的错误响应。

这是当我试图日志的相关部分npm publish之前npm login

19 verbose stack Error: 404 Not Found - PUT https://registry.npmjs.org/mock-fs - Not found
19 verbose stack     at /Users/tschaub/.nvm/versions/node/v14.8.0/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:117:15
19 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
20 verbose statusCode 404
21 verbose pkgid [email protected]
22 verbose cwd /Users/tschaub/projects/mock-fs
23 verbose Darwin 19.6.0
24 verbose argv "/Users/tschaub/.nvm/versions/node/v14.8.0/bin/node" "/Users/tschaub/.nvm/versions/node/v14.8.0/bin/npm" "publish"
25 verbose node v14.8.0
26 verbose npm  v6.14.8
27 error code E404
28 error 404 Not Found - PUT https://registry.npmjs.org/mock-fs - Not found
29 error 404
30 error 404 '[email protected]' is not in the npm registry.
31 error 404 You should bug the author to publish it (or use the name yourself!)
32 error 404 Note that you can also install from a
33 error 404 tarball, folder, http url, or git url.
34 verbose exit [ 1, true ]

所有3条评论

同样的错误。

上次发布 30.07 是成功的。 但是从 11.08 开始,我在发布时收到此错误:
2020-08-13T09:56:54.1669946Z 18 http fetch PUT 404 https://registry.npmjs.org/@aurigma%2fui-framework 5611ms
2020-08-13T09:56:54.1670114Z 19 详细堆栈错误:404 未找到 - PUT https://registry.npmjs.org/@aurigma%2fui-framework - 未找到

我试图从一台新机器上npm publish并得到同样意外的 404。在我的情况下,它是由npm login 。 我知道 401 可能会“泄漏”私有包的存在,但我认为 CLI 会首先检查我是否先通过身份验证并以更合适的错误响应。

这是当我试图日志的相关部分npm publish之前npm login

19 verbose stack Error: 404 Not Found - PUT https://registry.npmjs.org/mock-fs - Not found
19 verbose stack     at /Users/tschaub/.nvm/versions/node/v14.8.0/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:117:15
19 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
20 verbose statusCode 404
21 verbose pkgid [email protected]
22 verbose cwd /Users/tschaub/projects/mock-fs
23 verbose Darwin 19.6.0
24 verbose argv "/Users/tschaub/.nvm/versions/node/v14.8.0/bin/node" "/Users/tschaub/.nvm/versions/node/v14.8.0/bin/npm" "publish"
25 verbose node v14.8.0
26 verbose npm  v6.14.8
27 error code E404
28 error 404 Not Found - PUT https://registry.npmjs.org/mock-fs - Not found
29 error 404
30 error 404 '[email protected]' is not in the npm registry.
31 error 404 You should bug the author to publish it (or use the name yourself!)
32 error 404 Note that you can also install from a
33 error 404 tarball, folder, http url, or git url.
34 verbose exit [ 1, true ]

是的, npm login帮助。 前几天我也发现了这个。 但仍然不清楚为什么我必须重新授权
Npm 应该改进他们的错误信息。

此页面是否有帮助?
0 / 5 - 0 等级