Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-gyp configure gives "tunneling socket could not be established" #1235

Closed
papaiatis opened this issue Jun 16, 2017 · 4 comments
Closed

Comments

@papaiatis
Copy link

Hi!

I'm behind corporate proxy and I need to use node-gyp.
When calling "node-gyp configure" it always gives me this error: "tunneling socket could not be estabilished".
No matter if I correctly set npm proxy or specifiy the "--proxy" parameter, or even clear out proxy completely it gives this error.
When calling wget for the .tar.gz file it downloads just fine from the very same terminal.
I tried editing lib/install.js to download from http:// but that timed out.
Any help would be appreciated!

myuser@devpc ~/code/src $ node-gyp configure --verbose
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node', '/usr/bin/node-gyp', 'configure', '--verbose' ]
gyp info using node-gyp@3.6.2
gyp info using node@6.9.4 | linux | x64
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.9.4
gyp verb command install [ '6.9.4' ]
gyp verb install input version string "6.9.4"
gyp verb install installing version: 6.9.4
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 0
gyp verb needs "installVersion" 9
gyp verb install version is no good; reinstalling
gyp verb ensuring nodedir is created /home/myuser/.node-gyp/6.9.4
gyp http GET https://nodejs.org/download/release/v6.9.4/node-v6.9.4-headers.tar.gz
gyp verb download using proxy url: "http://proxy.mycompany.com:8080"
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.9.4' ]
gyp verb remove using node-gyp dir: /home/myuser/.node-gyp
gyp verb remove removing target version: 6.9.4
gyp verb remove removing development files for version: 6.9.4
gyp ERR! configure error 
gyp ERR! stack Error: tunneling socket could not be established, cause=Parse Error
gyp ERR! stack     at ClientRequest.onError (/usr/lib64/node_modules/node-gyp/node_modules/tunnel-agent/index.js:177:17)
gyp ERR! stack     at ClientRequest.g (events.js:291:16)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at ClientRequest.emit (events.js:188:7)
gyp ERR! stack     at Socket.socketOnData (_http_client.js:368:9)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Socket.emit (events.js:188:7)
gyp ERR! stack     at readableAddChunk (_stream_readable.js:176:18)
gyp ERR! stack     at Socket.Readable.push (_stream_readable.js:134:10)
gyp ERR! stack     at TCP.onread (net.js:548:20)
gyp ERR! System Linux 3.13.0-119-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "--verbose"
gyp ERR! cwd /home/myuser/code/src
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

@bnoordhuis
Copy link
Member

bnoordhuis commented Jun 16, 2017

Since you are on Linux, try strace -s 256 -fe read'ing node-gyp. 'Parse error' means the proxy sent a response that node's HTTP parser couldn't understand.

@refack
Copy link
Contributor

refack commented Jun 16, 2017

@papaiatis a workaround could be using the --tarball option. Ref: #1154 (comment)

@papaiatis
Copy link
Author

@refack Thanks, that worked!
@bnoordhuis strace was a good idea, but it did not give me any better clue what's wrong. It said I got HTTP 200 for that tarball file and then suddenly got the mentioned exception.

@refack
Copy link
Contributor

refack commented Jun 19, 2017

@papaiatis happy we could help.
I'm closing this, since IMHO it's more of a network configuration then a node-gyp issue. Feel free to reopen if you feel different, or have more information.

@refack refack closed this as completed Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants