如何清除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 delete proxy -g
npm config delete http-proxy -g

then

npm config get proxy

also

npm i -g bower to update

NPM在代理上有一个错误

其他回答

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

我曾经遇到过同样的问题。 按照以下步骤删除代理值: 1.在npm中删除代理: (-g很重要) NPM配置删除代理 NPM删除http-proxy NPM配置删除http -proxy 使用以下命令检查npm配置文件: NPM配置列表

2.删除系统代理。 设置HTTP_PROXY = null 设置HTTPS_PROXY = null

现在关闭命令行并打开它以刷新变量(代理)。

好的,“NPM config delete…”是Windows环境的正确命令,反之亦然,“NPM config rm…”是类unix环境的正确命令。 此外,至少对我来说,必须添加“-g”选项,因为该命令可以正常工作

尝试用以下方法删除它们:

npm config delete proxy
npm config delete https-proxy

这将清除代理从本地和全局配置没有-global它将只清除当前用户配置文件:

NPM配置rm代理 NPM配置rm http -proxy NPM配置——全局rm代理 NPM配置——global rm http -proxy