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条回答
forever°为你锁心
2楼-- · 2019-01-09 23:40

I've used

npm config set proxy null
npm config set https-proxy null

and it worked for me.

Best regards

查看更多
Melony?
3楼-- · 2019-01-09 23:42

Running npm version 2.10.1 in windows 7, I used:

npm config delete proxy
npm config delete https-proxy
查看更多
劳资没心,怎么记你
4楼-- · 2019-01-09 23:44

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.

查看更多
你好瞎i
5楼-- · 2019-01-09 23:48

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
查看更多
劫难
6楼-- · 2019-01-09 23:48

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
查看更多
疯言疯语
7楼-- · 2019-01-09 23:49

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
查看更多
登录 后发表回答