修改镜像源为淘宝镜像:输入以下命令并回车
npm config set registry https://registry.npmmirror.com
修改镜像源为腾讯镜像源:输入以下命令并回车
npm config set registry http://mirrors.cloud.tencent.com/npm/
修改镜像源为华为镜像源:输入以下命令并回车
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
淘宝源
npm config set registry https://registry.npm.taobao.org/
官方源
npm config set registry https://registry.npmjs.org/
临时使用某个源:
npm install --registry https://registry.npm.taobao.org
永久修改npm源:
npm config set registry https://registry.npm.taobao.org