安装yrm
npm install -g yrm
列出当前可用的镜像源
# yrm 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
yarn ---- https://registry.yarnpkg.com
切换镜像源
yrm use taobao
测试速度
yrm test taobao
全局修改镜像源
yarn config set registry https://registry.npm.taobao.org/
yarn config set registry https://registry.yarnpkg.com
# 提交到 npmjs package之前要执行
yarn config set registry http://registry.npmjs.org/