407 Authentication required npm

We should add proxy with username and password to avoid this error. For example:

  • username: admin
  • password: admin123
  • proxy: 172.10.3.21
  • port: 3128

npm config set proxy http://admin:[email protected]:3128
npm config set https-proxy http://admin:[email protected]:3128

I recommend reading through this article to configure the proxy for npm. http://wil.boayue.com/blog/2013/06/14/using-npm-behind-a-proxy/

  • npm config set proxy http://proxy.company.com:proxyport

  • npm config set http-proxy http://proxy.company.com:proxyport

  • npm config set https-proxy http://proxy.company.com:proxyport

Hope this is useful for you!


Usually, when you are behind a corporate proxy, it is needed to add the domain where you are at. Given that also the characters should be URL encoded, it would look like:

https://domain%5Cusername:password@proxy:port