如果國外官方的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