npm设置仓库

如果国外官方的npm仓库下载速度很慢的话,可以考虑更换npm仓库,加快下载包的速度。 
1.通过config命令

npm config set registry https://registry.npm.taobao.org 

npm config list #查看npm当前配置

 

2.命令行指定 
每次执行命令前加入–registry指定仓库路径

npm --registry https://registry.npm.taobao.org install

 

 

3.编辑 ~/.npmrc 加入下面内容

registry = https://registry.npm.taobao.org
posted @ 2017-03-14 13:51  btg.yoyo  阅读(7933)  评论(0编辑  收藏  举报