【发布时间】:2016-11-08 04:53:23
【问题描述】:
这是一个相当模糊的问题。我有一个 Angular 应用程序,它将通过 Codeship for CI 运行。但是,当需要在 Codeship 框上运行 npm install 时,npm 会返回
-npm ERR! fetch failed https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
\npm ERR! fetch failed https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
\npm ERR! fetch failed https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
npm ERR! Linux 4.2.0-38-generic
npm ERR! argv "/home/rof/.nvm/versions/node/v4.1.1/bin/node" "/home/rof/.nvm/versions/node/v4.1.1/bin/npm" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! fetch failed with status code 502
这很奇怪,因为 npm install 在我的盒子上工作得很好。我的第一直觉是它一定是 NPM 存储库的问题,所以我抓住了包的 url (https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz) 并将其放入新的 Chrome 选项卡中。果然,档案几乎立即下载。我对此感到困惑,所以我再次尝试了 Codeship 构建,但得到了相同的结果。我决定通过 SSH 连接到 Codeship 框,看看是否可以访问它。我跑了
curl https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz
正如我所料,我收到了 502 错误。但是,当我从我的机器上的终端运行相同的命令时,我得到了相同的结果,即使 npm install 对我来说运行得很好。我找不到其他人遇到此类问题,并且 502 似乎是 NPM 注册表返回的非常罕见的代码。有什么想法吗?
【问题讨论】:
-
问题是关于现在在 npm 注册服务器上发生的问题。 @andrey Romashin 的答案链接到正在进行的讨论,足以了解情况,但不应鼓励未来的讨论。