VS2017自带的npm会去国外的镜像下载文件, 奇慢无比, 还是马云家淘宝的镜像适合国内用户.

 

淘宝npm镜像地址:  https://registry.npm.taobao.org

 


 

VS中使用淘宝npm镜像, 需要以下两步:

 

步骤1.  修改npm config, 指向淘宝npm镜像, 有3种方法:   

 

1.通过config命令

 

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

 

 

npm info underscore (如果上面配置正确这个命令会有字符串response

 

 

2.命令行指定

 

npm --registry https://registry.npm.taobao.org info underscore 

 

 

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

 

registry = https://registry.npm.taobao.org

 

步骤2.  修改 VS 的 Web Package Management

            如图, 添加以下三项, 然后就可以愉快的在VS中使用淘宝npm镜像了.

Visual Studio 中设置npm

 

相关文章:

  • 2021-09-02
  • 2022-01-12
  • 2021-11-19
  • 2021-06-05
  • 2021-08-01
  • 2021-11-23
  • 2021-12-08
猜你喜欢
  • 2021-08-07
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-04-30
  • 2021-06-23
  • 2021-12-18
相关资源
相似解决方案