Skip to content

Instantly share code, notes, and snippets.

@zillingen
Last active June 20, 2024 10:51
Show Gist options
  • Save zillingen/5c4b8da657025c83ead59e1e547c7436 to your computer and use it in GitHub Desktop.
Save zillingen/5c4b8da657025c83ead59e1e547c7436 to your computer and use it in GitHub Desktop.
How to setup npm proxy settings behind proxy on Windows

Setup npm behind HTTP and HTTPS proxy on Windows

How to setup npm proxy settings behind HTTP and HTTPS proxy on Windows

Create .npmrc in home dir

In your user home dir create file .npmrc with your username and password:

proxy = http://user:password@your.proxy.server:8080
https_proxy = http://user:password@your.proxy.server:4443
strict-ssl = false

Run npm in command line

Open CMD and run command npm config list then check that proxy settings is enabled. Find lines like this:

; userconfig C:\your_home_dir\.npmrc
https_proxy = "http://user:password@your.proxy.server:4443"
proxy = http://user:password@your.proxy.server:8080
strict-ssl = false

If you found this lines you configured proxy correctly.

Debug

For debug enable HTTP logging in .npmrc:

# Enable http logging to console
loglevel = http

And run npm install with --verbose option.

If you want use npm with HTTP protocol instead HTTPS you can config it with:

# Enable HTTP instead HTTPS
registry = http://registry.npmjs.org/
@cyber468
Copy link

but i give password on one page and accept the EULA in the second how to overcome it and url us a very long string,should also include all the things other than the proxy ip and port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment