- NRM(npm registry manager)镜像源管理工具
两种切换方式:
一、
终端里输入如下命令即可切换至淘宝镜像源(mac下测试通过):
npm config set registry http://registry.npm.taobao.org/
二、
安装NRM
windows环境下安装命令:
npm install -g nrm
mac环境下安装命令:
sudo npm install -g nrm
安装好之后,通过如下命令可以查看当前可用的源:
npm ls
--------------------------
// 输出内容,*表示当前使用的源
// *npm ... https://
// taobao ... https://
// yarn ... https://
测试源响应速度:
nrm test npm
-------------
*npm ... 2236ms
nrm test taobao
-------------
*taobao ... 295ms
切换源命令:
nrm use taobao