NPM install failing with 502 error
Asked Answered
B

5

8

This is a rather obscure issue. I have an Angular app that will be running through Codeship for CI. However, when it comes time to run npm install on the Codeship box, npm gives back

-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

This was quite strange, since the npm install worked just fine on my box. My first instinct was that it had to be an issue with the NPM repository, so I grabbed the url for the package(https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz) and threw it into a new Chrome tab. Sure enough, the archive downloaded almost instantly. I was confused by this, so I tried the Codeship build again, but got the same results. I decided to SSH into the Codeship box to see if I could access it. I ran

curl https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz

and as I expected I got the 502 error. However, when I ran the same command from the terminal on my machine, I got the same result, even though the npm install ran perfectly for me. I wasn't able to find anyone else having this type of an issue, and a 502 seems like a very rare code for the NPM registry to be returning. Any ideas?

Baumgartner answered 6/7, 2016 at 7:55 Comment(1)
The questions is about a problem occurring right now on npm registry servers. @andrey Romashin's answers link to the ongoing discussion and is enough to be informed, but future discussions shouldn't be encouraged.Derose
F
6

This is a problem with the registry.npmjs.org in some regions.

Here is issue: https://github.com/npm/npm/issues/13284

Forerun answered 6/7, 2016 at 9:32 Comment(0)
C
6

Try to keep one registry inside .npmrc file, only one of them works. The order of registry also does matter. Also try to set:

  • npm config delete proxy
  • npm config delete https-proxy

to clean proxy inside terminal.

Cyndy answered 8/7, 2019 at 15:37 Comment(1)
This fixed this issue for me. Been happening on and off for weeks and this is the only thing that has fixed it.Webber
G
3

I'm seeing the same issue via npm install on Ubuntu 14 running on AWS

curl https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.0.tgz

returns 502 Bad Gateway from the ubuntu server, but works fine from local client

There's an open issue at NPM for this:

https://github.com/npm/npm/issues/13284

Gonfalonier answered 6/7, 2016 at 8:49 Comment(0)
M
2

NPM just acknowledged the issue and they are working on it. Your can track the status at below link.

http://status.npmjs.org

Maidenly answered 6/7, 2016 at 14:41 Comment(0)
E
0

I got this error while publishing my package on npm. After banging my head against the wall for a few hours, I realized I was on mobile hotsopt. I switched to wifi and bang there was my package on npm!

Earlearla answered 13/4, 2019 at 15:59 Comment(1)
What has mobile hotspot to do with it? I am permanently on mobile hotspot for internet access and I don't have WiFi. Any way I can solve the problem this case?Eterne

© 2022 - 2024 — McMap. All rights reserved.