Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
659 views
in Technique[技术] by (71.8m points)

node.js - NPM behind a proxy with the character "@" in my password

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After many research about this problem and test more than 10 solutions like set with this commands:

npm config set proxy "http://domain%5Cusername:password@servername:port/"

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.

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

registry=http://registry.npmjs.org

proxy=http://127.0.0.1:8888

https-proxy=http://127.0.0.1:8888

http-proxy=http://127.0.0.1:8888

strict-ssl=true

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...