Jun 06, 2018 node-http-proxy is an HTTP programmable proxying library that supports websockets. It is suitable for implementing components such as reverse proxies and load balancers. It is suitable for implementing components such as reverse proxies and load balancers.
How can I configure
node.js
and npm
to run behind a web proxy?
I tried the following solutions but they didn't work for me.
and
codename-
9,0582 gold badges21 silver badges29 bronze badges
mdalimdali
2 Answers
First open a command console at the location of your
npm
installation.
Then you can configure your npm to use a proxy using the commands:
Notice the protocol is set to
http
for both the proxy
and https-proxy
variables.
If you would like
npm
to store your credentials for the proxy, you can additionally modify the commands as follows:
For example:
Additional information here: Using npm behind corporate proxy .pac
Community♦
![Node set proxy free Node set proxy free](https://cdn-images-1.medium.com/max/1600/1*XviICXh4doDeG_ZyDB6Tkw.jpeg)
Blake YarbroughBlake Yarbrough
This worked for me!
- npm config set strict-ssl false
- npm config set registry https://registry.npmjs.org/
- npm config set proxy http://login:pass@host:port
- npm config set https-proxy http://login:pass@host:port
NOTE:Remember to add https:// instead of http:// when setting registry
![Set Set](https://i.stack.imgur.com/lYk1X.png)
Hope that helps.
Admond LeeAdmond Lee