Medium / phantomjs

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

Unable to install phantomjs on RHEL - socket hang up #602

Closed ciraxwe closed 8 years ago

ciraxwe commented 8 years ago

I keep getting the following error when I try to install phantomjs as global.

The server is behind a proxy and the proxy settings are correct. I'm able to install other modules form NPM like angular-cli.

npm WARN deprecated phantomjs@2.1.7:********@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
Error checking path, continuing { Error: Cannot find module '/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/lib/location'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at getLocationInLibModuleIfMatching (/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/install.js:332:19)
    at Promise._successFn (/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/install.js:389:28)
    at nextTickCallback (/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/node_modules/kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9) code: 'MODULE_NOT_FOUND' }
    Error making request.
Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1092:19)
    at TLSSocket.g (events.js:286:16)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:973:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

    Please report this full log at https://github.com/Medium/phantomjs
npm ERR! Linux 3.10.0-327.18.2.el7.x86_64
npm ERR! argv \"/opt/node/node-v6.3.0-linux-x64/bin/node\" \"/usr/bin/npm\" \"install\" \"--global\" \"phantomjs@latest\"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! phantomjs@2.1.7 install:********@2.1.7 install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the phantomjs 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 information on how to open an issue for this project with:
npm ERR!     npm bugs phantomjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/user/npm-debug.log", "rc": 1, "stderr": "npm WARN deprecated phantomjs@2.1.7: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
Error checking path, continuing { Error: Cannot find module '/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/lib/location'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at getLocationInLibModuleIfMatching (/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/install.js:332:19)
    at Promise._successFn (/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/install.js:389:28)
    at nextTickCallback (/opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/node_modules/kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9) code: 'MODULE_NOT_FOUND' }
    Error making request.
Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1092:19)
    at TLSSocket.g (events.js:286:16)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:973:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

    Please report this full log at https://github.com/Medium/phantomjs
npm ERR! Linux 3.10.0-327.18.2.el7.x86_64
npm ERR! argv \"/opt/node/node-v6.3.0-linux-x64/bin/node\" \"/usr/bin/npm\" \"install\" \"--global\" \"phantomjs@latest\"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! phantomjs@2.1.7 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs@2.1.7 install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the phantomjs 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 information on how to open an issue for this project with:
npm ERR!     npm bugs phantomjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/user/npm-debug.log
", "stdout": "/opt/node/node-v6.3.0-linux-x64/bin/phantomjs -> /opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs/bin/phantomjs

> phantomjs@2.1.7 install /opt/node/node-v6.3.0-linux-x64/lib/node_modules/phantomjs
> node install.js

Considering PhantomJS found at /opt/node/node-v6.3.0-linux-x64/bin/phantomjs
Looks like an `npm install -g`
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1//phantomjs-2.1.1-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Using proxy http://user:******@domain:8099/
Receiving...
nicks commented 8 years ago

It appears that your proxy is blocking the download of the binary. Per the troubleshooting guide, if you can't figure out how to fix your proxy settings, you can always put the phantomjs binary on PATH and the installer will use that. https://github.com/Medium/phantomjs#troubleshooting

ciraxwe commented 8 years ago

Thank you for the information