简体   繁体   中英

`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 ...

There is a Chinese registry now too:

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

It syncs with registry.npmjs.org.

Perhaps it will work with the European registry ?

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

Unless that is blocked also?

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

$ npm config set registry https://registry.npm.taobao.org/
$ npm install

just use taobao's mirror

npm install -g cnpm --registry=http://registry.npm.taobao.org
cnpm install -g your-lib-name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM