How to setup node-gyp behide a proxy
Asked Answered
U

3

15

When i install karma that use node-gyp to fetch package and do rebuild, and I got a "gyp Error!: connect ECONNERFUSED", THE problem whey node-gyp will connect to internet and my environment is behind corporate proxy, I could download package from npm and I setup npm's proxy already.

My environment is WINDOWS 7 64 bit.

I found no where to setting node-gyp in proxy. any idea for that?

[Update] Thanks. I got how to setup this, command as below node-gyp configure --proxy=http://proxy.address.com:port

node-gyp connect ECONNERFUSED

Uncharted answered 23/10, 2015 at 2:33 Comment(4)
Did you find a resolution?Biodegradable
Hi @HossamBarakat, yes, command as below node-gyp configure --proxy=proxy.address.com:portUncharted
Dint work for me I get gyp ERR! stack Error: tunneling socket could not be established, cause=write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown proBioscopy
I am behind a company firewall that uses ssl CA Certs anyone know how to add that to node-gyp?Relish
R
5

I am stuck behind a corporate firewall. The only solution I could find was to override the default SSL CA files with the company provided ones.

Solution using company ssl CA files: node-gyp configure --cafile="/path/to/mycafile.pem"

Relish answered 24/5, 2019 at 18:28 Comment(0)
O
3

I ran into this error recently. I believe the fix that finally solved it for me was adding an environment variable NODE_EXTRA_CA_CERTS. The value should be the same full path to a PEM-formatted certificate bundle for your proxy's root cert, similar to Tim's answer. The advantage is that it should work for any Node package that tries to make SSL connections.

Orit answered 28/7, 2022 at 8:9 Comment(0)
G
0

Setting npm proxy works for node-gyp and node-pre-gyp "fallback to build" installation. Even http proxy server works for https sites like github.com. Below command adds a new line proxy=http://localhost:7788 into your $HOME/.npmrc:

npm config set proxy http://localhost:7788
Gt answered 3/6, 2023 at 13:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.