I am behind a corporate proxy and I need to set the settings to npm. The only problem is my username contains a \
char. The proxy setting should look like this: http://PREFIX\username:[email protected]:port
but the end result is like this: http://prefix/username:[email protected]:port
which is totally wrong.
Putting %5C
instead of \
doesn't work. Neither does putting the username and password, or the whole url in ""
.
I know this question has been asked numerous times but none of the solutions did it for me. I am on a windows machine. I would be grateful if you have any suggestions.
You may get the error due to special characters. The solution is to use unicode characters in hexadecimal. You can use command line tool such as unum or gnome-character-map to convert special characters into hexadecimal unicode.
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.
You have to percent-encode | encode the special characters. E.g. instead of this:
http://foo:B/[email protected]:8080
you write this:
http://foo:B%[email protected]:8080
So /
gets replaced with %2F
.
Use %5C, it will replace '\'
http://foo:T\[email protected]:8080
to
http://foo:T%[email protected]:8080
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With