Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Im trying to run npm install command but i got this error Error: 503 Service Unavailable for npm install command, Can any one please im requesting you to solve this one.

This is actual complete error im getting on error log file

3413 verbose stack Error: 503 Service Unavailable - GET http://52.169.74.37:8081/repository/npm-private/@ctc%2fctc-pubsub-common
3413 verbose stack     at res.buffer.catch.then.body (C:\node\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15)
3413 verbose stack     at process._tickCallback (internal/process/next_tick.js:68:7)
3414 verbose statusCode 503
3415 verbose pkgid @ctc/ctc-pubsub-common@^1.0.5
3416 verbose cwd C:\Users\vktest\pro
3417 verbose Windows_NT 10.0.15063
3418 verbose argv "C:\\node\\node.exe" "C:\\node\\node_modules\\npm\\bin\\npm-cli.js" "install"
3419 verbose node v10.16.3
3420 verbose npm  v6.9.0
3421 error code E503
3422 error 503 Service Unavailable - GET http://52.169.74.37:8081/repository/npm-private/@ctc%2fctc-pubsub-common
3423 verbose exit [ 1, true ]

Seems like your npm registry config pointing to some private registry that is down or unavailable.

Try to check npm configuration :

npm config get registry

It should be like :

 http://52.169.74.37:8081

So update the config which will point to offical registry.

 npm config set registry https://registry.npmjs.com/
                No @Adil its still showing same error even after i tried  npm config set registry registry.npmjs.com this its showing same error
– venu kumar
                Sep 16, 2019 at 5:45
npm config set proxy "http://proxy.url:port/"
npm config set https-proxy "http://proxy.url:port/"
npm config set strict-ssl false
npm config set registry "https://registry.npmjs.org/"

There is a good explanation of issue and solution

NPM Error "failed to fetch from registry" when Installing Module

Old/Buggy NPM Version

As you might have noticed from the error message above, the npm version being used is pretty old. In this example we were using Node v0.6.10 and npm v1.1.0-3. This version is known to have some problems with Ubuntu 12.04, so your best bet is to update Node (and npm along with it) to the newest version:

$ sudo npm update npm -g

If you want to re-install completely, you'll first want to completely remove the current Node/npm executables:

$ sudo apt-get purge nodejs npm

Then re-install using a more updated version, like from Nodesource:

$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get install -y nodejs

Or, even better, you can check out this article for a more thorough guide to installing Node.js on Ubuntu.

Can't Download Over HTTPS

For one reason or another, some people can't connect to the registry via HTTPS. This can be fixed by setting the registry to use HTTP instead:

$ npm config set registry http://registry.npmjs.org/
$ npm config set strict-ssl false

This isn't recommended, however, since your packages will then be downloaded insecurely. It would be best to find the actual root cause instead of using a work-around like this.

Corporate Proxy

For many people, the root cause is actually because a proxy is being used on their network. If this is the case, you can use the following commands to set the HTTP and HTTPS proxies:

$ npm config set proxy http://user:password@proxy.example.com:8181
$ npm config set https-proxy http://user:password@proxy.example.com:8181

This will save the new configurations and should allow you to access the internet with npm.

No its not working @Ankit kumar i tried npm --registry registry.npmjs.eu install karma but still showing same error – venu kumar Sep 16, 2019 at 5:44

I have a same problem with the publish.

first, I remove proxy and https-proxy config with this command:

npm config delete proxy
npm config delete https-proxy

then I publish my package with this command:

npm publish

I hope is useful.

In my case the NO_PROXY variable was missing, but HTTP_PROXY was set. NPM tried to go over the proxy, which was wrong in my case.

I declared the npm config variable noproxy (without underscore)

npm set noproxy "localhost,.mydomain.de"

Alternately one can set the environment variable NO_PROXY (with underscore)

SET NO_PROXY=localhost,.mydomain.de 

ATTENTION: npm doesn't understand "*" (*.mydomain.de would be wrong) and multiple servers must be separated by "," (not semicolon).

Tested with Windows 10 and nodejs16 (npm 8.19.2) und nodejs19 (npm 8.19.3)

OP is saying Im trying to run npm install command but i got this error and your answer is to do npm install. Isn't this exactly what OP already did? – Eric Aya Jan 27, 2021 at 18:04

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.