1、查看当前的npm镜像源
npm config get registry
终端输出:
2、将npm镜像源切换到国内的淘宝镜像源
npm config set registry https://registry.npm.taobao.org
3、将npm镜像源切换到官方npm镜像源
npm config set registry https://registry.npmjs.org
npm config get registry
终端输出:
npm config set registry https://registry.npm.taobao.org
npm config set registry https://registry.npmjs.org