由现有安装好的npm,替换成淘宝的cnpm
1. 查看当前镜像地址
npm get registry
2. 将https://registry.npmjs.org 替换为 https://registry.npm.taobao.org
sudo npm config set registry https://registry.npm.taobao.org
3. 安装cnpm
sudo npm install cnpm -g
由现有安装好的npm,替换成淘宝的cnpm
npm get registry
sudo npm config set registry https://registry.npm.taobao.org
sudo npm install cnpm -g