直接使用cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
切换源
// 淘宝源
npm config set registry https://registry.npm.taobao.org
// 默认源
npm config set registry https://registry.npmjs.org
// 查看当前源
npm config get registry
npm install -g cnpm --registry=https://registry.npm.taobao.org
// 淘宝源
npm config set registry https://registry.npm.taobao.org
// 默认源
npm config set registry https://registry.npmjs.org
// 查看当前源
npm config get registry