NPM配置镜像源

1 淘宝镜像源

1. 命令
npm config set registry https://registry.npmmirror.com

2. 验证命令
npm config get registry
如果返回https://registry.npmmirror.com,说明镜像配置成功。

2 腾讯镜像源

1、命令
npm config set registry http://mirrors.cloud.tencent.com/npm/

2. 验证命令
npm config get registry
如果返回http://mirrors.cloud.tencent.com/npm/,说明镜像配置成功。

3 华为镜像源

1. 命令
npm config set registry https://mirrors.huaweicloud.com/repository/npm/

2. 验证命令
npm config get registry
如果返回https://mirrors.huaweicloud.com/repository/npm/,说明镜像配置成功。

4 淘宝定制的cnpm

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

2. 使用cnpm
cnpm install xxx

 

posted on 2025-01-10 15:58  zhangzongshan  阅读(342)  评论(0)    收藏  举报

导航