0%

解决npm下载慢问题

npm镜像:

淘宝:http://registry.npm.taobao.org

腾讯云:http://mirrors.cloud.tencent.com/npm/

华为云:https://mirrors.huaweicloud.com/repository/npm/

下载时临时使用淘宝镜像

Windows使用powershell管理员打开,输入一下命令:

1
npm install xxx --registry=http://registry.npm.taobao.org

永久更改镜像
1
npm config set registry http://registry.npm.taobao.org

再执行 npm config get registry 返回 http://registry.npm.taobao.org 则设置成功


通过使用淘宝定制的cnpm安装:
  • 安装cnpm

npm install -g cnpm --registry=https://registry.npmmirror.com

  • 使用cnpm

cnpm install xxx

+