再次吐槽下万恶的墙。使用npm install切换源时,可使用下面的方法:
安装
$ npm install -g nrm
例子
$ nrm ls
* npm ----- https://registry.npmjs.org/
cnpm ---- http://r.cnpmjs.org/
taobao -- https://registry.npm.taobao.org/
nj ------ https://registry.nodejitsu.com/
rednpm -- http://registry.mirror.cqupt.edu.cn
skimdb -- https://skimdb.npmjs.com/registry
切换
$ nrm use cnpm //switch registry to cnpm
Registry has been set to: http://r.cnpmjs.org/