Why is npm giving 500 and 503 errors: “registry error parsing json”?

房东的猫 提交于 2019-11-29 01:38:16

问题


Trying to do npm install steroids -g and running into lots of errors of two types:

First: 500

npm ERR! registry error parsing json
npm http 500 https://registry.npmjs.org/cardinal
npm ERR! registry error parsing json
npm http 500 https://registry.npmjs.org/glob
npm ERR! registry error parsing json
npm http 500 https://registry.npmjs.org/chmodr
npm ERR! registry error parsing json
npm http 500 https://registry.npmjs.org/fstream
npm ERR! registry error parsing json

when I visit those urls in the browser I get the following message:

Internal routing error

Sorry, we cannot connect to the intended server.

We have just been notified of this problem. We will correct it as soon as possible.

Feel free to contact us if you have any questions: support@iriscouch.com

Second: 503

npm http 503 https://registry.npmjs.org/forever-agent
npm ERR! registry error parsing json
npm http 503 https://registry.npmjs.org/cheerio
npm ERR! registry error parsing json
npm http 503 https://registry.npmjs.org/request
npm ERR! registry error parsing json
npm http 503 https://registry.npmjs.org/diff
npm ERR! registry error parsing json
npm http 503 https://registry.npmjs.org/tar

When I visit those urls in the browser I get this message:

Error 503 backend read error

backend read error

Guru Meditation:

XID: 1448084160

Varnish cache server

Does this mean the npm registry is down? or do I have strange behavior on my machine?

Running node v.0.10.24 & npm v.1.3.21


回答1:


Try using a mirror for example the european mirror:

npm --registry http://registry.npmjs.eu/ install karma



回答2:


From @npmjs around 15mins after your question was made:

"aware of the outage. please be patient. working to resolve this now."

On side note, read Node Roundup: Surviving npm Downtime, Waf Wall of Shame, stream-chat, Vein, interest info about NPM mirrors. Kinda outdated (2012) but now you know it has mirrors ;-)

Also, a good advice by 'mark' at the comments of this blogpost I linked:

If you're relying on NPM for production deployments, STOP! Make sure you set specific versions and clone them in your private repo. Deploy from your private repo not the NPM registry. You have been warned. Relying on NPM for production deployment scripts has bitten us twice! The first was because a library author deleted an old version of his library we depended on. This time it was the NPM registry itself.




回答3:


npm has a status page where any server incidence will (should) be reflected:

https://status.npmjs.org



来源:https://stackoverflow.com/questions/21122814/why-is-npm-giving-500-and-503-errors-registry-error-parsing-json

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!