微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

node.js – NPM安装失败,出现502错误

这是一个相当模糊的问题.我有一个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安装在我的盒子上运行得很好.我的第一直觉是它必须是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安装完全适合我.我无法找到其他人遇到此类问题,而502似乎是一个非常罕见的NPM注册表返回代码.有任何想法吗?

解决方法

这是某些地区的registry.npmjs.org的问题.

这是问题:
https://github.com/npm/npm/issues/13284

原文地址:https://www.jb51.cc/nodejs/445727.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐