第一种方式:切换淘宝镜像
#查看当前的下包镜像源
npm config get registry
---https://registry.npmjs.org/
#将下包镜像源切换为淘宝镜像
npm config set registry=https://registry.npm.taobao.org/
第二种方式:
#安装nrm
npm install nrm -g
#查看当前镜像源的列表
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
#查看当前镜像源
npm config get registry