How to clear https proxy setting of NPM?
node.jsProxynode.js Problem Overview
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.
I try to set proxy to nothing:
npm config set http-proxy
npm config set https-proxy
the first command pass yet the second one warn that:
npm WARN invalid config proxy=""
npm WARN invalid config Must be a full url with 'http://'
is the warning neglectable and I have successfully clear the proxy setting?
node.js Solutions
Solution 1 - node.js
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
Solution 2 - node.js
Try deleting them with:
npm config delete proxy
npm config delete https-proxy
Solution 3 - node.js
npm config rm proxy
npm config rm https-proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset http_proxy
unset https_proxy
Damn finally this does the trick in Debian Jessie with privoxy (ad remover) installed, Thank you :-)
Solution 4 - node.js
This was already answered but I think the --global
config is not covered properly.
By running npm config rm proxy
you remove proxy from user configuration.
This can be easily verified by running: npm config list
.
If there is proxy
or https-proxy
setting set in global config you have to use --global
in the command to remove it.
So at the end this will clean-up proxies from both local and global configs:
npm config rm proxy
npm config rm https-proxy
npm config --global rm proxy
npm config --global rm https-proxy
Solution 5 - node.js
In the latest version npm rm proxy
does not work. Instead use npm rm http-proxy
npm config rm proxy npm config rm https-proxy
Solution 6 - node.js
By the default value npm
is looking for packages from https://registry.npmjs.org
. What you also need to do is override the registry
and strict-ssl
values.
npm config set registry "http://registry.npmjs.org"
npm config set strict-ssl false
Solution 7 - node.js
I have used the below commands for removing any proxy set:
npm config rm proxy
npm config rm https-proxy
And it solved my problem :)
Solution 8 - node.js
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:
- Deleting http_proxy and https_proxy config settings alone will not help if you still have HTTP_PROXY or http_proxy environment variable is set to something and
- Setting registry to use http:// and setting strict-ssl to false will not help you if you are not behind a proxy anyway and have HTTP_PROXY set to something.
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.
Solution 9 - node.js
there is a simple way of deleting or removing the npm proxies.
npm config delete proxy
npm config delete https-proxy
Solution 10 - node.js
I had the same problem once.
Follow these steps to delete proxy values:
1.To delete proxy in npm:
(-g is Important)
npm config delete proxy -g
npm config delete http-proxy -g
npm config delete https-proxy -g
Check the npm config file using:
npm config list
2.To delete system proxy:
set HTTP_PROXY=null
set HTTPS_PROXY=null
Now close the command line and open it to refresh the variables(proxy).
Solution 11 - node.js
Nothing above worked for me. I had to edit the file ".npmrc" which will be under user home directory (ex: c:\users\abcuser) :
http_proxy=null
registry=https://registry.npmjs.org/
strict-ssl=true
proxy=null
Solution 12 - node.js
Running npm version 2.10.1 in windows 7, I used:
npm config delete proxy
npm config delete https-proxy
Solution 13 - node.js
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
Solution 14 - node.js
The easiest way to remove any configuration at all from npm is to edit the npm config file. It only takes two(2) commands to do this; one to open npm config file for editing, the other to confirm your change.
- type
npm config list
to view a list of all npm configurations that are active. - type
npm config edit
to open a text editor with npm configurations. To remove the proxy line ( or simply comment it out ). - Save the config file and close it.
- type
npm config list
to confirm that the proxy configuration has been removed.
C'est la vie!
I tried everything listed on this page, none worked, then I tried to the config edit. It worked instantly. (I use Windows 10)
Solution 15 - node.js
Try This,
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
Solution 16 - node.js
npm config delete proxy -g
worked for me.
-g
was important as initially it was set with that option.
You can check configurations set with :
npm config list
Solution 17 - node.js
npm config rm proxy
npm config rm https-proxy
Worked for me
Solution 18 - node.js
I think it's not http-proxy but proxy:
npm config set proxy="http://yourproxyhere"
Solution 19 - node.js
Got exactly the same problem, I keep seeing my proxy configuration even after removing the npmrc file and deleting the keys.
I found out that npm were using windows env key http-proxy by default.
So go in Computer->Properties->Advanced system settings->Environement variables and check there is no http-proxy key configured.
Solution 20 - node.js
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 tohttps_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
Solution 21 - node.js
See the npm Settings in file C:\Users\myusers.npmrc
file. Sometime the npm proxy config settings does not apply. so its worth checking in there.
Solution 22 - node.js
npm config delete http-proxy
npm config delete https-proxy
npm config delete proxy -g
npm config delete http-proxy -g
then
npm config get proxy
> null
also
npm i -g bower to update
npm had a bug on the proxy
Solution 23 - node.js
execute npm config list it will list down all proxy values.. in my case proxy value was fetched form global npmrc file, removed it and was able to complete npm install on my windows machine
Solution 24 - node.js
Well, I'm gonna leave this here because I was having a big trouble with NPM.
I was trying to change a proxy setting using npm config set proxy "http://.../"
and then running npm config get proxy
. It was ALWAYS returning a wrong value, different from the one that I'd set.
I found out that I had a .npmrc
COMMITED on the project I was trying to run npm install
and that this file was overriding my own config.
So it was cleaning the proxy value, but I needed to also change the .npmrc
inside the folder's project.
After that, everything worked fine.
Solution 25 - node.js
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/[email protected]" --no-proxy
Solution 26 - node.js
I've used
npm config set proxy null
npm config set https-proxy null
and it worked for me.
Best regards
Solution 27 - node.js
this works for me fime
proxy=http://<username>:<pass>@proxyhost:<port>
https-proxy=http://<uname>:<pass>@proxyhost:<port>
sample in my instance username:uname and password:pword
npm config set proxy=http://uname:[email protected]:8080
npm config set https-proxy=http://uname:[email protected]:8080
Solution 28 - node.js
I was struggling with this for ages. What I finally did was go into the .npmrc file (which can be found in the user's directory followed by the user's name, ie. C:\Users\erikj/.npmrc), opened it with a text editor, manually removed any proxy settings and changed the http:// setting to https://. In this case, it is a matter of experimenting whether http or https will work for you. In my case, https worked. Go figure.
Solution 29 - node.js
In my case, (windows OS), after put all those commands listed, npm kept taking the proxy in the setting of windows registry
\ HKEY_CURRENT_USER \ Environment
just remove the proxy settings there, after that, I restarted the pc and then "npm install" worked for me
Solution 30 - node.js
Http Module is deprecated and it is replaced with HttpClient.
Change your imports to import { HttpClientModule }
from '@angular/common/http';
Solution 31 - node.js
Here is my solution: Step 1:
> env |grep proxy e.g,I got: > http_proxy > https_proxy
Step2: unset the proxy variables > unset http_proxy >unset https_proxy
Then npm install works ok now
Solution 32 - node.js
this will clean-up proxies from both local and global configs without --global it will clear only from the current user profile:
npm config rm proxy npm config rm https-proxy npm config --global rm proxy npm config --global rm https-proxy
Solution 33 - node.js
You will get the proxy host and port from your server administrator or support.
After that set up
npm config set http_proxy http://username:[email protected]:itsport npm config set proxy http://username:[email protected]:itsport If there any special character in password try with % urlencode. Eg:- pound(hash) shuold be replaced by %23.
This worked for me...
Solution 34 - node.js
ok, "NPM config delete ..." is the right command for Windows environment, viceversa "NPM config rm ..." it is for Unix-like environment. Moreover, at least for me, it was mandatory to add the option "-g" because the command worked properly