npm 切换镜像源

274 阅读1分钟

1. 查看当前镜像

npm config get registry

2. 添加淘宝镜像

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

3. 安装管理工具nrm

npm install -g nrm

4. 查看所有镜像

nrm ls

5.新增源

nrm add <源名称> <地址>

6. 使用某个源

nrm use <源名称>

7.测试速度

nrm test <源名称>