- 1.切换npm 下包镜像源 就是下包的服务器地址
1.检查当前的下包镜像源
npm config get registry
2.将下包的镜像源切换为淘宝镜像源
npm config set registry = https://registry.npm.taobao.org/
3.检查镜像源是否下载成功
npm config get registry
- 2.安装nrm这个小工具,利用nrm提供的终端命令,可以快速查看和切换下包的镜像源
1.通过npm包管理器,将nrm安装为全局可用工具
npm i nrm -g
2.查看所有可用的镜像源
nrm ls
3.将下包的镜像源切换为 taobao镜像
nrm use taobao