Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm gets stuck on fetchMetadata -> network

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.

like image 925
Dushyant Bangal Avatar asked Jun 16 '16 13:06

Dushyant Bangal


2 Answers

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" 
like image 73
G07cha Avatar answered Sep 18 '22 01:09

G07cha


try yarn installer instead of npm:

sudo npm install -g yarn yarn install 

I found it much more resilient to such problems.

like image 43
Tomer Ben David Avatar answered Sep 20 '22 01:09

Tomer Ben David