npm warn invalid config proxy config Must be a ful

2019-06-04 20:11发布

问题:

This question already has an answer here:

  • Escape @ character in git proxy password 5 answers

Please look into it as it is not working for me:

npm warn invalid config proxy http://'Accenture\username:userpassword@2017'@127.0.0.1:8080 npm warn invalid config Must be a full url with 'http://'

回答1:

Finally i got the issue resolved with the help from network guy

strict-ssl=false
proxy = http://ip address of proxy:8088
https-proxy = https://ip address of proxy:8088 
registry = http://registry.npmjs.org/


回答2:

If you wish to change any of the configuration properties in npm, the section on config on npmjs.com is useful: https://docs.npmjs.com/cli/config

The full proxy configuration for npm is

npm config set http-proxy http://username:password@proxy-address.com:80/'
npm config set https-proxy http://username:password@proxy-address.com:80/'

That should work for you, you can also double check it's set by typing npm config list

http-proxy = "http://username:password@proxy-address.com:80/"
https-proxy = "http://username:password@proxy-address.com:80/"

Further to that, if you prefer to edit the config file directly it is stored in a file called .npmrc that can be added either to each project root or the global settings in your user directory, please see the npmrc help content https://docs.npmjs.com/files/npmrc

In relation to your question, if your password contains special characters, they need to be escaped. This url provides useful information on special characters: http://www.cyberciti.biz/faq/unix-linux-export-variable-http_proxy-with-special-characters/

As an example, if your password were P@ssword then it will become P%40ssword.