npm gets stuck on fetchMetadata -> network

Dushyant Bangal picture Dushyant Bangal · Jun 16, 2016 · Viewed 54.1k times · Source

My npm is getting stuck a lot, whether its npm install from package.json or individual packages.

Right now, I'm not even able to sudo npm install node-inspector -g

I'm using node 6.2.1, npm 3.9.5 on ubuntu 16.04

npm cache clear didn't help. The installation takes hours or fails.

Answer

G07cha picture G07cha · Jun 16, 2016

Check if there any issues with proxies if you using any. You can try also to set npm's endpoint manually:

npm config set registry="http://registry.npmjs.org"