npm config set proxy http://proxy.company.com:8080
Is how I set a proxy for my node installation. How can I access this configured proxy from inside my nodejs application?
npm config set proxy http://proxy.company.com:8080
Is how I set a proxy for my node installation. How can I access this configured proxy from inside my nodejs application?
您可以调用npm config list
一个子进程,它将返回所有配置,类似于这个:
; cli configs
registry = "https://registry.npmjs.org/"
; userconfig /home/username/.npmrc
email = "name@domain.com"
username = "name"
; node bin location = /home/name/apps/nvm/v0.10.7/bin/node
; cwd = /home/name/subfolder
; HOME = /home/name
; 'npm config ls -l' to show all defaults.
用于npm config ls -l
获取完整列表,其中包括默认配置设置。