I\'m trying to run npm behind a proxy. I\'ve tried both entering the proxy directly or through Authoxy:
npm config set proxy http://localho
I had the same issue and finally it was resolved by disconnecting from all VPN .
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.
Due to security violations, organizations may have their own repositories.
set your local repo as below.
npm config set registry https://yourorg-artifactory.com/
I hope this will solve the issue.
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
On windows 10, do
npm config edit
This will open config file in a text editor. Delete all the set proxy variables by user and only let default values stay.
;;;;
; npm userconfig file
; this is a simple ini-formatted file
; lines that start with semi-colons are comments.
; read `npm help config` for help on the various options
;;;;
--->Delete everything proxy settings from here.
;;;;
; all options with default values
;;;;
Close and save. Try again. That's what worked for me in my localhost.
On windows10, create this file. Worked for me.