切换 npm 源工具 nrm
npm config ls 查看 npm 使用的源
安装
npm install -g nrm
查看源列表
nrm ls
npm ---------- https://registry.npmjs.org/
yarn --------- https://registry.yarnpkg.com/
tencent ------ https://mirrors.cloud.tencent.com/npm/
cnpm --------- https://r.cnpmjs.org/
taobao ------- https://registry.npmmirror.com/
npmMirror ---- https://skimdb.npmjs.com/registry/
切换源
nrm use yarn
如果要使用哪个源就 nrm use yarn 就切换到了 yarn 源上
自定义源
nrm add
其中,registry 为源名,url 为源地址。
nrm add cpm http://192.168.22.11:8888/repository/npm-public/
删除源
nrm del
registry 为源名
测试源速度
nrm test
npm ------ 897ms
yarn ----- 977ms
tencent -- 328ms
cnpm ----- 1898ms
* taobao --- 241ms
npmMirror - 2503ms