NPM User and Proxy settings - chaitanyavangalapudi/devops-scripts GitHub Wiki

npm Settings

Add below lines to your .bashrc or .bash_profile.

username="testuser"
password="password%40123"
proxy="proxyhostORip:8080"

npm config set registry "http://registry.npmjs.org/"
npm config set proxy "http://$username:$password@$proxy"
npm config set http-proxy "http://$username:$password@$proxy"
npm config set https-proxy "http://$username:$password@$proxy"
npm config set strict-ssl false

npm config ls -l

If your password contains special characters like @ or $, replace them with corresponding ASCII character.


References: