Proxy settings for npm

METHOD 1
To set the proxy
npm config set proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port- number>
npm config set https-proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port-number>

To delete or remove the proxy
npm config delete proxy
npm config delete https-proxy
(or)
npm config rm proxy
npm config rm https-proxy

To check the proxy
npm config list

METHOD 2:
or else you can directly go to .npmrc file and type the below proxy commands and save it
npm config set proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port- number>
npm config set https-proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port-number>

Comments

Post a Comment