因为npm的registry地址是国外的,速度很慢,因此推荐使用淘宝镜像:https://registry.npm.taobao.orgnpm
npm --registry https://registry.npm.taobao.org install <Module Name>
code
npm config set registry https://registry.npm.taobao.org
get
恢复原来地址的方法:
npm config set registry https://registry.npmjs.org
class
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用时用cnpm代替npm:如cnpm install <Module Name>
配置