1.设置http类型的服务器的代理

$ npm config set proxy http://server:port

 

2.设置https类型的服务器的代理

$ npm config set proxy https://server:port

 

3.设置npm镜像

$ npm config set registry "http://registry.npmjs.org/"

$ npm config set registry "http://registry.npm.taobao.org/"

 

4.使用nrm管理npm镜像

安装nrm

$ npm install -g nrm

列出可用镜像

$ nrm ls

使用淘宝镜像

$ nrm use taobao 

npm - 设置代理和镜像

 

 

相关文章:

  • 2022-01-13
  • 2021-09-20
  • 2021-06-25
  • 2022-02-18
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-26
  • 2021-09-09
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
相关资源
相似解决方案