npm國內淘寶鏡像

理由

因爲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.orgget

恢復原來地址的方法:
npm config set registry https://registry.npmjs.orgclass

使用cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org
使用時用cnpm代替npm:如cnpm install <Module Name>配置

相關文章
相關標籤/搜索