How to clear https proxy setting of NPM?

2019-01-09 22:59发布

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 proxy
26条回答
女痞
2楼-- · 2019-01-09 23:52

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

查看更多
劳资没心,怎么记你
3楼-- · 2019-01-09 23:54

Try deleting them with:

npm config delete proxy
npm config delete https-proxy
查看更多
我命由我不由天
4楼-- · 2019-01-09 23:54

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:password@proxyofmycomp.com:itsport npm config set proxy http://username:password@proxyofmycomp.com:itsport If there any special character in password try with % urlencode. Eg:- pound(hash) shuold be replaced by %23.

This worked for me...

查看更多
倾城 Initia
5楼-- · 2019-01-09 23:54

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

查看更多
贪生不怕死
6楼-- · 2019-01-09 23:55

there is a simple way of deleting or removing the npm proxies.

npm config delete proxy
npm config delete https-proxy
查看更多
闹够了就滚
7楼-- · 2019-01-09 23:56

I think it's not http-proxy but proxy:

npm config set proxy="http://yourproxyhere"
查看更多
登录 后发表回答