如何清除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 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

其他回答

这对我有用

proxy=http://<username>:<pass>@proxyhost:<port>

https-proxy=http://<uname>:<pass>@proxyhost:<port>

示例在我的实例用户名:uname和密码:pword

npm config set proxy=http://uname:pword@192.168.5.8:8080

npm config set https-proxy=http://uname:pword@192.168.5.8:8080

以上这些方法对我都没有帮助,但下面这条有用:

npm config rm proxy
npm config rm https-proxy

来源:http://jonathanblog2000.blogspot.ch/2013/11/set-and-reset-proxy-for-git-and-npm.html

我已经使用下面的命令来删除任何代理集:

    npm config rm proxy
    npm config rm https-proxy

它解决了我的问题:)

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

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

请参阅文件C:\Users\myusers.中的npm设置npmrc文件。有时npm代理配置设置不适用。所以值得一查。