Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.43k stars 436 forks source link

Error making request. Tunneling socket could not be established #381

Open tkomiya24 opened 9 years ago

tkomiya24 commented 9 years ago

This happens when I am behind a proxy. My proxy, and https-proxy are set correctly. All the other packages in my package.json install successfully. strict-ssl is false. I have checked my http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY, ftp_proxy, FTP_PROXY, no_proxy, NO_PROXY variables are set.

Error making request. Error: tunneling socket could not be established, cause=140735248642816:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:782:

at ClientRequest.onError (/Users/i845085/Documents/Projects/cli/node_modules/phantomjs2/node_modules/request/node_modules/tunnel-agent/index.js:174:17)
at ClientRequest.g (events.js:180:16)
at ClientRequest.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1548:9)
at CleartextStream.emit (events.js:95:17)
at SecurePair.<anonymous> (tls.js:1411:15)
at SecurePair.emit (events.js:95:17)
at SecurePair.error (tls.js:1018:27)
at CleartextStream.read [as _read] (tls.js:463:17)
at CleartextStream.Readable.read (_stream_readable.js:341:10)

Please report this full log at https://github.com/Medium/phantomjs

pre-commit@1.1.1 install /Users/i845085/Documents/Projects/cli/node_modules/pre-commit node install.js

npm ERR! phantomjs2@2.0.0 install: node install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the phantomjs2@2.0.0 install script. npm ERR! This is most likely a problem with the phantomjs2 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node install.js npm ERR! You can get their info via: npm ERR! npm owner ls phantomjs2 npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 14.5.0 npm ERR! command "/Users/i845085/.nvm/v0.10.40/bin/node" "/Users/i845085/.nvm/v0.10.40/bin/npm" "install" npm ERR! cwd /Users/i845085/Documents/Projects/cli npm ERR! node -v v0.10.40 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0

matthewwiesen commented 7 years ago

Solving this issue shouldn't be something that PhantomJS should worry about. This should be solved within node.js to have node actually support HTTP Proxy.

https://github.com/nodejs/node/issues/8381

abhi19gupta commented 6 years ago

Somehow, it worked for me when I set the the value for https_proxy to be the same as that of http_proxy i.e. the one with "http://...". Strange but worked.

Command: npm config set https-proxy http://<proxy_server>:<port>