I have a problem with npm I can't get any package. For example running :
npm install -g npm@latest
gives :
npm ERR! code E500 npm ERR!
500 Internal Server Error: npm@latest
If I try to access https://registry.npmjs.org/ I get :
Fastly error: unknown domain.
Please check that this domain has been added to a service.
I looked into my /etc/hosts and nothing wrong there, any ideas ?
---------------- INFOS -----------
NodeJS : v9.2.0
npm : 6.0.1
OS : Ubuntu 16.04.4 LTS
Below step resolve my npm registry issue. I hope same will be work for you.
npm config set registry https://registry.npmjs.org/
curl https://registry.npmjs.org/
npm cache clean --force
npm install
From corporate network sometimes you won't be able to properly resolve registry.npmjs.org. To workaround the problem do the following.
dig registry.npmjs.org @1.1.1.1
Take any of the ip in the output and add to /etc/hosts
104.16.16.35 registry.npmjs.org
You should be good to go now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With