nrm 可以快速的帮我们在不同的镜像中切换。
安装
npm
npm i -g nrm
yarn
yarn global add 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 taobao
查看当前源
nrm current
结果如下:
SUCCESS The registry has been changed to 'taobao'.
测试速度
nrm test
结果如下:
npm ---------- 1013 ms
yarn --------- 1437 ms
tencent ------ 101 ms
cnpm --------- 1364 ms
* taobao ------- 215 ms
npmMirror ---- 1865 ms
常见问题
mac m1 芯片可能会修改失败,可以执行以下命令解决
npm uninstall -g nrm
npm i -g @adams549659584/nrm
评论区
评论加载中...