Configure Nodejs behind a proxy

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

Proxy and authen

Have to encoded the backslash \

# Do not run this
# npm config set proxy "http://Domain\MyUserName:password@servername:port/"

# run this

npm config set proxy "http://Domain%5CMyUserName:password@servername:port/"

Git bash proxy on WIndows

Better to make aliases.

Add new lines into %USERPROFILE%\.bashrc or %USERPROFILE%\.bash_profile

alias npm_myproxy='npm --proxy http://my-proxy-server:8080 --https-proxy http://my-proxy-server:8080 --strict-ssl false '

alias npm_noproxy='npm --proxy null --https-proxy null --strict-ssl false '

Loading