1.切换淘宝源
npm config set registry https://registry.npm.taobao.org --global
2.验证配置
npm config get registry
3.使用cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
1.切换到淘宝cnpm
npm config set registry https://registry.npm.taobao.org
2.检查配置
npm config get registry
3.还原npm
npm config set registry https://registry.npmjs.org