How to clear https proxy setting of NPM?
如何清除NPM的以前的SSL代理设置?
好吧,我搜索了很多东西,但是我得到的所有帖子主要是关于如何在公司网络中
我尝试将代理设置为空:
1 2 | npm config set http-proxy npm config set https-proxy |
第一个命令传递而第二个警告:
1 2 | npm WARN invalid config proxy="" npm WARN invalid config Must be a full url with 'http://' |
可以忽略的警告,并且我已经成功清除了代理设置?
以上都不对我有帮助,但这确实做到了:
1 2 | npm config rm proxy npm config rm https-proxy |
资料来源:http://jonathanblog2000.blogspot.ch/2013/11/set-and-reset-proxy-for-git-and-npm.html
尝试使用以下方法删除它们:
1 2 | npm config delete proxy npm config delete https-proxy |
1 2 3 4 5 6 | npm config rm proxy npm config rm https-proxy unset HTTP_PROXY unset HTTPS_PROXY unset http_proxy unset https_proxy |
最终该死的,这在Debian Jessie中安装了privoxy(广告卸妆剂)就可以了,谢谢:-)
这已经得到回答,但是我认为
通过运行
如果在全局配置中设置了
因此,最后这将从本地和全局配置中清除代理:
1 2 3 4 | npm config rm proxy npm config rm https-proxy npm config --global rm proxy npm config --global rm https-proxy |
如果您查看npm config文档,它将显示:
proxy
Default: HTTP_PROXY or http_proxy environment variable, or
nullType: url
因此,要禁用代理使用,必须将
另外,重要的是要注意:
-
仅删除http_proxy和https_proxy配置设置不会
帮助您,如果您仍然具有HTTP_PROXY或http_proxy环境变量
设置为 -
将注册表设置为使用http://并进行设置
如果您不使用代理,则将strict-ssl设置为false不会对您有帮助
无论如何,并将HTTP_PROXY设置为某些内容。
如果npm将代理设置的类型设置为boolean以打开/关闭代理使用会更好。或者,他们可以引入类型为boolean的sort
默认情况下,
1 2 | npm config set registry"http://registry.npmjs.org" npm config set strict-ssl false |
我已使用以下命令删除任何代理集:
1 2 | npm config rm proxy npm config rm https-proxy |
它解决了我的问题:)
有一种简单的删除或删除npm代理的方法。
1 2 | npm config delete proxy npm config delete https-proxy |
在最新版本中,
npm config rm https-proxy
我曾经有过同样的问题。
请按照以下步骤删除代理值:
1.要在npm中删除代理,请执行以下操作:
(-g很重要)
使用以下命令检查npm配置文件:
2.要删除系统代理:
现在关闭命令行并打开它以刷新变量(代理)。
在Windows 7中运行npm 2.10.1版本,我使用了:
1 2 | npm config delete proxy npm config delete https-proxy |
以上对我没有任何帮助。我必须编辑文件" .npmrc",该文件将位于用户主目录下(例如:c: users abcuser):
1 2 3 4 | http_proxy=null registry=https://registry.npmjs.org/ strict-ssl=true proxy=null |
这有效
1 2 3 4 5 6 7 8 | 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 |
从npm删除所有配置的最简单方法是编辑npm配置文件。只需两(2)条命令即可完成此操作;一个打开npm配置文件进行编辑,另一个确认您的更改。
删除代理行(或简单地将其注释掉)。
这就是生活!
我尝试了此页面上列出的所有内容,但均无效果,然后尝试进行配置编辑。它立即起作用。 (我使用Windows 10)
1 | npm config delete proxy -g |
为我工作。
您可以使用以下命令检查配置设置:
1 | npm config list |
我认为这不是http-proxy,而是代理:
1 | npm config set proxy="http://yourproxyhere" |
1 2 | npm config rm proxy npm config rm https-proxy |
为我工作
就我而言(基于Ubuntu的Linux Mint 16),我必须:
清除
1 2 3 4 | $ http_proxy='' https_proxy='' npm config get https-proxy null $ http_proxy='' xxhttps_proxy='' npm config get https-proxy https://1.2.3.4:8080 |
遇到了完全相同的问题,即使删除了npmrc文件并删除了密钥,我仍然看到我的代理配置。
我发现npm默认使用Windows env键http-proxy。
因此,进入"计算机"->"属性"->"高级系统设置"->"环境变量",并检查是否未配置http-proxy密钥。
请参阅文件
执行npm配置列表
它会列出所有代理值。.在我的情况下,代理值是从全局npmrc文件中提取的,将其删除并能够在Windows机器上完成npm安装
1 2 3 4 5 | npm config delete http-proxy npm config delete https-proxy npm config delete proxy -g npm config delete http-proxy -g |
然后
1 | npm config get proxy |
null
也
1 | npm i -g bower to update |
npm在代理上有错误
这对我有用
1 2 3 | proxy=http://<username>:<pass>@proxyhost:<port> https-proxy=http://<uname>:<pass>@proxyhost:<port> |
我的实例中的示例用户名:uname和密码:pword
1 2 3 | npm config set proxy=http://uname:[email protected]:8080 npm config set https-proxy=http://uname:[email protected]:8080 |
我一直为此苦苦挣扎。我最后要做的是进入.npmrc文件(可以在用户目录中找到,后跟用户名,即C: Users erikj / .npmrc),用文本编辑器将其打开,手动删除任何代理设置,并将http://设置更改为https://。在这种情况下,您可以尝试使用http还是https。就我而言,https有效。去搞清楚。
好吧,我要离开这里,因为我在NPM方面遇到了很大麻烦。
我试图使用
我发现我尝试运行
因此,它正在清除代理值,但我还需要更改文件夹项目中的
之后,一切正常。
我用过
1 2 | npm config set proxy null npm config set https-proxy null |
它为我工作。
最好的祝福
不推荐使用Http模块,并用HttpClient代替。
将导入内容从
好的," NPM config delete ..."是适用于Windows环境的正确命令,反之则" NPM config rm ..."则适用于类似Unix的环境。
此外,至少对于我来说,必须添加选项" -g",因为该命令可以正常运行
您将从服务器管理员或支持人员那里获得代理主机和端口。
在那之后设置
npm config设置http_proxy http://用户名:[email protected]:itsport
npm配置设置代理http:// username:[email protected]:itsport
如果密码中有任何特殊字符,请尝试使用%urlencode。例如:-英镑(哈希)替换为%23。
这对我有用...