如何清除NPM之前的ssl代理设置? 嗯,我搜索了很多,但我得到的所有帖子主要是关于如何在公司网络中设置代理。

我试图设置代理为空:

npm config set http-proxy
npm config set https-proxy

第一个命令传递,第二个命令警告说:

npm WARN invalid config proxy=""
npm WARN invalid config Must be a full url with 'http://'

警告是否可忽略,我是否已成功清除代理设置?


当前回答

npm config rm proxy
npm config rm https-proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset http_proxy
unset https_proxy

该死的,这终于做到了在Debian Jessie与privoxy(广告删除器)安装的技巧,谢谢你:-)

其他回答

npm config delete proxy -g

为我工作。

-g很重要,因为最初它是用这个选项设置的。 您可以检查配置设置:

npm config list
npm config rm proxy
npm config rm https-proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset http_proxy
unset https_proxy

该死的,这终于做到了在Debian Jessie与privoxy(广告删除器)安装的技巧,谢谢你:-)

在默认值下,npm从https://registry.npmjs.org寻找包。您还需要重写注册表和严格ssl值。

npm config set registry "http://registry.npmjs.org"
npm config set strict-ssl false

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

我使用

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

这对我很有效。

致以最亲切的问候