修改鏡像源為淘寶鏡像:輸入以下命令并回車
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