Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't delete npm proxy

Tags:

npm

proxy

In work I have a proxy and set this in npm

 npm config set proxy http://theproxy:8080
 npm config set https-proxy https://theproxy:8080

Out of work I don't have the proxy and need to remove it in npm.

I've tried

 npm config rm proxy
 npm config rm https-proxy

and

 npm config delete proxy
 npm config delete https-proxy

but when I use

 npm config get proxy
 npm config get https-proxy

the proxy is still there

How do I remove the proxy in npm

like image 851
ttmt Avatar asked Dec 09 '14 21:12

ttmt


People also ask

How do I get rid of proxy?

In the System section, click on Open your computer's proxy settings. On Windows 10, this will open the Proxy settings window. Under Automatic proxy setup, switch off: Automatically detect settings & Use setup script. Under Manual proxy setup, switch off: Use a proxy server, then click on Save.

How do I find my npm proxy settings?

Open Settings > System > Open Proxy Settings > LAN Settings In LAN Settings you can find the proxy server and its port no.

Why do we need .npmrc file?

The npmrc manages the npm config files. The config setting for npm is gotten from the command line, environment variables and the npmrc files. You can use the npm config command to update and edit the contents of the user and global npmrc files.


3 Answers

Below things worked for me, make sure environment variable HTTP_PROXY is unset before removing config entries

Unsetting HTTP_PROXY= is very important

set HTTP_PROXY=
npm config rm proxy
npm config rm https-proxy
npm config rm http-proxy
like image 99
Chandre Gowda Avatar answered Nov 15 '22 13:11

Chandre Gowda


It works very well for me ..

saidas-mbp:trunk saidababuchanda$ npm config set proxy https://www.google.com
saidas-mbp:trunk saidababuchanda$ npm config get proxy 
https://www.google.com
saidas-mbp:trunk saidababuchanda$ npm config delete proxy 
saidas-mbp:trunk saidababuchanda$ 
saidas-mbp:trunk saidababuchanda$ npm config get proxy 
null
saidas-mbp:trunk saidababuchanda$ npm -v
1.4.14
saidas-mbp:trunk saidababuchanda$ 

Please look at your npm version

like image 25
Saida Babu Chanda Avatar answered Nov 15 '22 12:11

Saida Babu Chanda


Try this

npm config delete proxy
npm config delete proxy -g
npm config delete https-proxy
npm config delete https-proxy -g

like image 42
Manfye Goh Avatar answered Nov 15 '22 12:11

Manfye Goh