代理后面的NPM(字符为"@")用我的密码 [英] NPM behind a proxy with the character "@" in my password
问题描述
我正在尝试设置NPM(v9.4.0)代理,但是运行npm i -g npm@latest
时遇到以下错误:
I am trying to set NPM (v9.4.0) proxy but I am facing the following error when running npm i -g npm@latest
:
npm ERR! code E407
npm ERR! 407 Proxy Authentication Required: npm@latest
我用于代理的密码包含一个"@"字符,我怀疑这是问题的根本原因.我尝试在"@"之前加上"\",并且
The password I use for the proxy contains an "@" character an I suspect this is the root cause of the issue. I tried with a "\" before the "@" and also
npm config set proxy http://"user:MyP@ssword"@proxy.big.corp.fr:8080
npm config set https-proxy http://"user:MyP@ssword"@proxy.big.corp.fr:8080
但没有成功.有人有主意吗?
but without success. Does anyone have an idea?
推荐答案
经过许多关于此问题的研究并测试了10多个解决方案,例如使用以下命令设置的解决方案:
After many research about this problem and test more than 10 solutions like set with this commands:
npm配置设置代理" http://domain%5Cusername:password @ servername:port/"
npm config set proxy "http://domain%5Cusername:password@servername:port/"
但对我不起作用. 然后测试 CNTLM ,但是CNTLM对我不起作用.我尝试了所有可能的组合. NPM正在提供身份验证错误. 最终,我测试了Fiddler并节省了时间.易于安装和配置.打开Fiddler =>规则=>自动认证.
but not worked for me. then test CNTLM but CNTLM didn't work for me. I tried all possible combinations. NPM was giving Authentication error. finally i test Fiddler and saved my time. It is easy to install and configure. Open Fiddler => Rule => Automatically Authenticated.
打开C:\ Users \您的用户名\ .npmrc文件并使用此配置
Open C:\Users\your username\.npmrc file and use this configurations
registry = http://registry.npmjs.org
registry=http://registry.npmjs.org
proxy = http://127.0.0.1:8888
https-proxy = http://127.0.0.1:8888
https-proxy=http://127.0.0.1:8888
http-proxy = http://127.0.0.1:8888
http-proxy=http://127.0.0.1:8888
strict-ssl = true
strict-ssl=true
删除此路径C:\ Users \ your username \ AppData \ Roaming中的npm文件夹. 使用以下命令:
remove npm folder in this path C:\Users\your username\AppData\Roaming. Using following command:
npm install express npm卸载-g @ angular/cli npm缓存清理--force npm install -g @ angular/cli
npm install express npm uninstall -g @angular/cli npm cache clean --force npm install -g @angular/cli
这篇关于代理后面的NPM(字符为"@")用我的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!