export http_proxy=http://localhost:8080
or
export https_proxy=https://localhost:8080
ALL_PROXY=socks5://127.0.0.1:1080 brew upgrade
also works
export all_proxy="socks5://127.0.0.1:1080"; curl'https://api.ipify.org?format=json'
###Setup npm proxy
For HTTP:
npm config set proxy http://proxy_host:port
For HTTPS:
npm config set https-proxy http://proxy.company.com:8080
npm config delete
npm install some-package --verbose