Proxy Can';t删除npm代理

Proxy Can';t删除npm代理,proxy,npm,Proxy,Npm,在工作中,我有一个代理并在npm中设置它 npm config set proxy http://theproxy:8080 npm config set https-proxy https://theproxy:8080 我没有代理,需要在npm中删除它 我试过了 npm config rm proxy npm config rm https-proxy 及 但是当我使用 npm config get proxy npm config get https-proxy 代理仍然

在工作中,我有一个代理并在npm中设置它

 npm config set proxy http://theproxy:8080
 npm config set https-proxy https://theproxy:8080
我没有代理,需要在npm中删除它

我试过了

 npm config rm proxy
 npm config rm https-proxy

但是当我使用

 npm config get proxy
 npm config get https-proxy
代理仍然在那里


如何在npm中删除代理它对我来说非常有效

saidas-mbp:trunk saidababuchanda$ npm config set proxy https://www.google.com
saidas-mbp:trunk saidababuchanda$ npm config get proxy 
https://www.google.com
saidas-mbp:trunk saidababuchanda$ npm config delete proxy 
saidas-mbp:trunk saidababuchanda$ 
saidas-mbp:trunk saidababuchanda$ npm config get proxy 
null
saidas-mbp:trunk saidababuchanda$ npm -v
1.4.14
saidas-mbp:trunk saidababuchanda$ 

请查看您的npm版本

我怀疑,它是在您的npmrc文件中的某个位置设置的,您可以检查以下文件吗?以查看该值是否设置在某个位置

npmrc文件

四个相关文件是: 每个项目配置文件(/path/to/my/project/.npmrc) 每个用户配置文件(~/.npmrc) 全局配置文件($PREFIX/npmrc)
npm内置配置文件(/path/to/npm/npmrc)

以下是对我有用的内容,请确保在删除配置项之前取消设置环境变量HTTP\u PROXY

取消设置HTTP_PROXY=非常重要
我认为你的问题是你需要在全球范围内消除它。尝试:

npm config rm proxy -g
npm config rm https-proxy -g
三步解决方案。 对我有效的是将
代理设置为空字符串/url,然后我使用
npm config delete
删除
https代理设置

因此,我运行了以下命令:

npm config set proxy
npm config delete https-proxy -g
此外,您还可以运行
npm config list
来验证这些值是否确实已被删除

现在还有最后一件事,您需要运行以下命令:

npm配置编辑

将在默认文本编辑器中打开一个文件,在该文件中删除您添加的所有代理配置。

尝试此操作

npm配置删除代理
npm配置删除代理-g
npm配置删除https代理

npm config delete https proxy-g

我在这个线程中尝试了所有的解决方案,但都没有成功。问题是代理设置在我的“C:\Users\YOURNAME.npmrc”文件中被注释了。取消注释对我来说很有效

proxy=null


https proxy=null

在我的情况下,问题是当我在包含.npmrc文件的特定文件夹项目中时,试图删除代理。 在该文件中有此特定文件夹的代理定义。
因此,我删除了里面的代理定义。

如果我执行
npm config ls-l
我会得到所有设置的列表,其中包括
proxy=“proxy.theproxy.co.uk:8080”
。如果我执行
npm配置设置代理https://www.google.com 
然后
npm config ls-l
google.com被设置为代理,但我仍然有
;proxy=“proxy.theproxy.co.uk:8080”(已覆盖)
。我有1.4.14版。删除npm安装是否是一个好主意,这会有任何帮助。
npm config rm proxy
npm config rm https-proxy
npm config rm http-proxy
npm config rm proxy -g
npm config rm https-proxy -g
npm config set proxy
npm config delete https-proxy -g