NPM
相关推荐
顶部

npm 代理与镜像配置

代理配置

  • 设置 http 代理
shell
npm config set proxy http://127.0.0.1:7890
  • 设置 https 代理
shell
npm config set https-proxy http://127.0.0.1:7890
  • 取消 http 代理
shell
npm config delete proxy
  • 取消 https 代理
shell
npm config delete https-proxy
  • 查看 http 代理
shell
npm get proxy
  • 查看 https 代理
shell
npm get https-proxy

镜像配置

  • 设置镜像源(官方)
shell
npm config set registry https://registry.npmjs.org/
  • 设置镜像源(淘宝)
shell
npm config set registry https://registry.npmmirror.com
  • 取消镜像源(转为官方镜像源)
shell
npm config delete registry
  • 查看镜像源
shell
npm get registry
  • 单次使用镜像源
shell
npm install --registry=https://registry.npmmirror.com

✨相关推荐✨

✨ NRM - NPM 的镜像源管理工具✨ Vite 配置一览✨ SPA (单页面应用)和 MPA (多页面应用)✨ Glob 模式匹配✨ SPA 首屏加载优化