Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`npm install` goes to dead in China

It halts when using npm to install dependencies for node.js applications. But works without any problem outside China. Who know ways to make it works beside VPN/SSH channel.

$ npm install
npm http GET https://registry.npmjs.org/jade
npm http GET https://registry.npmjs.org/formidable
# ... ... halt for hours and hours ... march 2014
# ... ... halts times after times ...
like image 439
Andrew_1510 Avatar asked Mar 31 '14 14:03

Andrew_1510


4 Answers

just use taobao's mirror

npm install -g cnpm --registry=http://registry.npm.taobao.org
cnpm install -g your-lib-name
like image 21
Codefor Avatar answered Oct 30 '22 14:10

Codefor


Another mirror in China is https://registry.npm.taobao.org/.

$ npm config set registry https://registry.npm.taobao.org/
$ npm install
like image 21
Hantsy Avatar answered Oct 30 '22 13:10

Hantsy


Perhaps it will work with the European registry?

$ npm config set registry http://registry.npmjs.eu
$ npm install

Unless that is blocked also?

like image 26
Bino Carlos Avatar answered Oct 30 '22 14:10

Bino Carlos


There is a Chinese registry now too:

$ npm config set registry http://r.cnpmjs.org
$ npm install

It syncs with registry.npmjs.org.

like image 74
MMM Avatar answered Oct 30 '22 14:10

MMM