Npm/yarn 设置下载源

nrm —— 快速切换 NPM 源

npm install -g nrm

1
2
3
4
5
6
7
* npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - http://registry.npm.taobao.org/
eu ----- http://registry.npmjs.eu/
au ----- http://registry.npmjs.org.au/
sl ----- http://npm.strongloop.com/
nj ----- https://registry.nodejitsu.com/

切换到 taobao

nrm use taobao

增加源

nrm add <registry> <url> [home]

删除源

nrm del <registry>

测试所有源的响应时间

nrm test

yarn 查看下载源

yarn config get registry

更换为淘宝源

yarn config set registry https://registry.npm.taobao.org