Using the command line to set NPM proxy variables. You can set each command globally by adding a -g at the end of the line.
Set the http proxy – Rememebr to replace the http://proxy.url:8080 with your specific values.
npm config set proxy http://proxy.url:8080
Set the https proxy – Rememebr to replace the URL and port number with your specific values.
npm config set https-proxy http://proxy.url:8080
Most proxies use SSL interception and replace the hosts SSL certificate with one of their own, you can have the URLs required added to any SSL Bypass policy by your proxy server admin, import your proxy servers CA into your NPM setup or tell NPM to ignore errors with SSL certificates
In this example we’re simply telling NPM to ignore the errors, this is less secure importing your proxy certificate but a quicker way of working.
npm config set strict-ssl false
npm config set proxy http://proxy.url:8080 -g
There are further settings which may need to be added that might be discussed in a future post.