最开始使用npm下载的一些插件的话用的国外的源,下载速度比较慢,有几种方式可以解决;

第一种

直接设置淘宝的源:npm config set registry http://registry.npm.taobao.org/

然后使用npm install xxx

 

第二种

安装cnpm,npm install -g cnpm --registry=https://registry.npm.taobao.org

然后以后都是用cnpm安装插件,cnpm install xxx

 

第三种

使用nrm

1.下载nrm:npm install -g nrm

2.列出可以选择的源:nrm ls

3.选择想要使用的源:nrm use taobao

4.查看当前npm使用的源:npm config get registry

切换npm源

 

 

5.后续的想安装什么插件直接使用npm install xxx就行了

相关文章:

  • 2021-12-11
  • 2021-08-14
  • 2022-12-23
  • 2021-08-25
  • 2021-12-29
  • 2022-03-10
  • 2022-12-23
  • 2021-10-06
猜你喜欢
  • 2022-02-07
  • 2021-07-18
  • 2021-09-14
  • 2021-05-29
  • 2021-11-08
相关资源
相似解决方案