简体   繁体   English

`npm install`在中国死了

[英]`npm install` goes to dead in China

It halts when using npm to install dependencies for node.js applications. 当使用npmnode.js应用程序安装依赖项时,它会停止。 But works without any problem outside China. 在中国境外没有任何问题。 Who know ways to make it works beside VPN/SSH channel . 谁知道如何使它在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. 它与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/ . 中国的另一面镜子是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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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