因爲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>
配置