How can I clear the previous ssl proxy setting of NPM?
well, I search a lot, but all post I got is mainly about how to set
proxy in corporate network.
This works
npm config delete http-proxy
npm config delete https-proxy
npm config rm proxy
npm config rm https-proxy
set HTTP_PROXY=null
set HTTPS_PROXY=null
If you want to switch between proxy for company network and remove proxy for home/personal network you can use --no-proxy
Sample usage:
npm install --save-dev "@angular/animations@8.2.14" --no-proxy
If you go through the npm config documentation, it says:
proxy
Default: HTTP_PROXY or http_proxy environment variable, or null
Type: url
As per this, to disable usage of proxy, proxy
setting must be set to null
. To set proxy value to null, one has to make sure that HTTP_PROXY
or http_proxy
environment variable is not set. So unset these environment variables and make sure that npm config ls -l
shows proxy = null
.
Also, it is important to note that:
It would have been better if npm had made the type of proxy setting to boolean to switch on/off the proxy usage. Or, they can introduce a new setting of sort use_proxy
of type boolean.
I've used
npm config set proxy null
npm config set https-proxy null
and it worked for me.
Best regards
None of the above helped me, but this did:
npm config rm proxy
npm config rm https-proxy
Source: http://jonathanblog2000.blogspot.ch/2013/11/set-and-reset-proxy-for-git-and-npm.html
In my case (Linux Mint 16 based on Ubuntu), I had to:
npm config delete https-proxy
, and also
clear the https_proxy
Bash environment parameter — oddly enough, although I cannot find this behavior documented anywhere, npm fallbacks to https_proxy
:
$ http_proxy='' https_proxy='' npm config get https-proxy
null
$ http_proxy='' xxhttps_proxy='' npm config get https-proxy
https://1.2.3.4:8080