npm源管理

1. 安装淘宝镜像

为了提高npm的安装速度,可以使用淘宝镜像

使用淘宝镜像的方法有两种:

1. npm install -g cnpm --registry=https://registry.npm.taobao.org

cnpm install [name]  // ----推荐

2. 替换npm的源,npm config set registry https://registry.npm.taobao.org

npm install [name]

⚠️使用cnpm有一个好处,可以命令同步最新的模块。(只有cnpm有

cnpm sync connect

 2. 使用nrm管理npm源

npm install -g nrm

查看所有命令

nrm --help

查看当前源

nrm current

查看所有源

nrm ls

切换源

nrm use npm

添加源

nrm add XXX
原文地址:https://www.cnblogs.com/lyraLee/p/10195895.html