一.通过命令配置
npm config set registry https://registry.npm.taobao.org
npm config get registry
二、通过使用cnpm安装
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install xxx
npm使用淘宝镜像
原文:https://www.cnblogs.com/xseven/p/14742170.html