带有字符“@"的代理后面的 NPM在我的密码中 [英] NPM behind a proxy with the character "@" in my password

查看:25
本文介绍了带有字符“@"的代理后面的 NPM在我的密码中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置 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:Usersyour username.npmrc 文件并使用这个配置

Open C:Usersyour username.npmrc file and use this configurations

registry=http://registry.npmjs.org

registry=http://registry.npmjs.org

代理=http://127.0.0.1:8888

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

删除此路径中的 npm 文件夹 C:Usersyour usernameAppDataRoaming.使用以下命令:

remove npm folder in this path C:Usersyour usernameAppDataRoaming. Using following command:

npm install express
npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/cli

这篇关于带有字符“@"的代理后面的 NPM在我的密码中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆