npm 设置http/https代理:
npm config set proxy=http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890
npm 取消设置http/https代理:
npm config delete proxy
npm config delete https-proxy
npm 查看仓库配置:
$ npm config get registry
https://registry.npmmirror.com
npm 查看配置信息:
$ npm config list
; "user" config from /home/guoshipeng/.npmrc
https-proxy = "http://127.0.0.1:7890"
proxy = "http://127.0.0.1:7890"
registry = "https://registry.npmmirror.com"
; node bin location = /home/guoshipeng/.nvm/versions/node/v20.17.0/bin/node
; node version = v20.17.0
; npm local prefix = /home/guoshipeng
; npm version = 10.8.2
; cwd = /home/guoshipeng
; HOME = /home/guoshipeng
; Run `npm config ls -l` to show all defaults
