npm behind a proxy fails with status 403
Solution 1:
OK, so within minutes after posting the question, I found the answer myself here: https://github.com/npm/npm/issues/2119#issuecomment-5321857
The issue seems to be that npm is not that great with HTTPS over a proxy. Changing the registry URL from HTTPS to HTTP fixed it for me:
npm config set registry http://registry.npmjs.org/
I still have to provide the proxy config (through Authoxy in my case), but everything works fine now.
Seems to be a common issue, but not well documented. I hope this answer here will make it easier for people to find if they run into this issue.
Solution 2:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
credit goes to http://jjasonclark.com/how-to-setup-node-behind-web-proxy.
Solution 3:
If you need to provide a username and password to authenticate at your proxy, this is the syntax to use:
npm config set proxy http://usr:pwd@host:port
npm config set https-proxy http://usr:pwd@host:port
Solution 4:
If anyone else ends up breaking their proxy config settings go to your .npmrc, to type in the settings. This file is located at your node root folder level.
Here's whats my corrected file looks like:
#proxy = http://proxy.company.com:8080
https-proxy = https://proxy.company.com:8080
registry = http://registry.npmjs.org/