Medium / phantomjs

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

error phantomjs@1.9.15 install: `node install.js` : ELIFECYCLE #555

Closed stevekuznetsov closed 8 years ago

stevekuznetsov commented 8 years ago

Installing phantom.js 1.9.15 on AWS EC2 I intermittently see this failure in my console output:

Jun 14 07:46:21 npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
Jun 14 07:46:21 npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12
Jun 14 07:46:21 npm WARN origin-web-console@1.3.0-alpha No license field.
Jun 14 07:46:21 npm ERR! Linux 3.10.0-229.7.2.el7.x86_64
Jun 14 07:46:21 npm ERR! argv "node" "/bin/npm" "install" "--unsafe-perm"
Jun 14 07:46:21 npm ERR! node v0.10.42
Jun 14 07:46:21 npm ERR! npm  v3.7.3
Jun 14 07:46:21 npm ERR! code ELIFECYCLE
Jun 14 07:46:21 
Jun 14 07:46:21 npm ERR! phantomjs@1.9.15 install: `node install.js`
Jun 14 07:46:21 npm ERR! Exit status 1
Jun 14 07:46:21 npm ERR! 
Jun 14 07:46:21 npm ERR! Failed at the phantomjs@1.9.15 install script 'node install.js'.
Jun 14 07:46:21 npm ERR! Make sure you have the latest version of node.js and npm installed.
Jun 14 07:46:21 npm ERR! If you do, this is most likely a problem with the phantomjs package,
Jun 14 07:46:21 npm ERR! not with npm itself.
Jun 14 07:46:21 npm ERR! Tell the author that this fails on your system:
Jun 14 07:46:21 npm ERR!     node install.js
Jun 14 07:46:21 npm ERR! You can get information on how to open an issue for this project with:
Jun 14 07:46:21 npm ERR!     npm bugs phantomjs
Jun 14 07:46:21 npm ERR! Or if that isn't available, you can get their info via:
Jun 14 07:46:21 npm ERR!     npm owner ls phantomjs
Jun 14 07:46:21 npm ERR! There is likely additional logging output above.
Jun 14 07:46:21 
Jun 14 07:46:21 npm ERR! Please include the following file with any support request:
Jun 14 07:46:21 npm ERR!     /data/src/github.com/openshift/origin-web-console/npm-debug.log

Here is the relevant snippet (I think) of npm-debug.log:

123306 silly install phantomjs@1.9.15 /data/src/github.com/openshift/origin-web-console/node_modules/.staging/phantomjs-bd80f995
123307 info lifecycle phantomjs@1.9.15~install: phantomjs@1.9.15
123308 verbose lifecycle phantomjs@1.9.15~install: unsafe-perm in lifecycle true
123309 verbose lifecycle phantomjs@1.9.15~install: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/data/src/github.com/openshift/origin-web-console/node_modules/phantomjs/node_modules/.bin:/data/src/github.com/openshift/origin-web-console/node_modules/.bin:/bin:/data/src/github.com/openshift/origin/_output/etcd/bin:/data/src/github.com/openshift/origin/_output/local/bin/linux/amd64:/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin
123310 verbose lifecycle phantomjs@1.9.15~install: CWD: /data/src/github.com/openshift/origin-web-console/node_modules/phantomjs
123311 silly lifecycle phantomjs@1.9.15~install: Args: [ '-c', 'node install.js' ]
123312 silly lifecycle phantomjs@1.9.15~install: Returned: code: 1  signal: null
123313 info lifecycle phantomjs@1.9.15~install: Failed to exec install script
123314 verbose unlock done using /home/ec2-user/.npm/_locks/staging-134801eafffac3dc.lock for /data/src/github.com/openshift/origin-web-console/node_modules/.staging
123315 silly rollbackFailedOptional Starting
123316 silly rollbackFailedOptional Finishing
123317 silly runTopLevelLifecycles Starting
123318 silly runTopLevelLifecycles Finishing
123319 silly install printInstalled
123320 warn optional Skipping failed optional dependency /chokidar/fsevents:
123321 warn notsup Not compatible with your operating system or architecture: fsevents@1.0.12
123322 warn origin-web-console@1.3.0-alpha No license field.
123323 verbose stack Error: phantomjs@1.9.15 install: `node install.js`
123323 verbose stack Exit status 1
123323 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
123323 verbose stack     at EventEmitter.emit (events.js:98:17)
123323 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
123323 verbose stack     at ChildProcess.emit (events.js:98:17)
123323 verbose stack     at maybeClose (child_process.js:766:16)
123323 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
123324 verbose pkgid phantomjs@1.9.15
123325 verbose cwd /data/src/github.com/openshift/origin-web-console
123326 error Linux 3.10.0-229.7.2.el7.x86_64
123327 error argv "node" "/bin/npm" "install" "--unsafe-perm"
123328 error node v0.10.42
123329 error npm  v3.7.3
123330 error code ELIFECYCLE
123331 error phantomjs@1.9.15 install: `node install.js`
123331 error Exit status 1
123332 error Failed at the phantomjs@1.9.15 install script 'node install.js'.
123332 error Make sure you have the latest version of node.js and npm installed.
123332 error If you do, this is most likely a problem with the phantomjs package,
123332 error not with npm itself.
123332 error Tell the author that this fails on your system:
123332 error     node install.js
123332 error You can get information on how to open an issue for this project with:
123332 error     npm bugs phantomjs
123332 error Or if that isn't available, you can get their info via:
123332 error     npm owner ls phantomjs
123332 error There is likely additional logging output above.
123333 verbose exit [ 1, true ]

Please let me know if you would like other information about my system to help debug this issue

knowgod commented 8 years ago

I got very similar issue:

npm ERR! Linux 4.4.0-24-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! node v4.2.6 npm ERR! npm v3.5.2 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn

npm ERR! phantomjs@1.9.20 install: node install.js npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the phantomjs@1.9.20 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.

I got rid of this by installing nodejs-legacy in my Ubuntu 16.04: sudo apt install nodejs-legacy

nicks commented 8 years ago

this indicates you don't have node installed, please read the troubleshooting guide https://github.com/Medium/phantomjs#troubleshooting

in particular: https://github.com/Medium/phantomjs#im-on-debian-or-ubuntu-and-the-installer-failed-because-it-couldnt-find-node

stevekuznetsov commented 8 years ago

@nicks

Just ran into this again on EC2 and I do have node installed.

$ which node
/bin/node
$ node --version
v0.10.42
$ which npm
/bin/npm
$ npm --version
3.7.3
stevekuznetsov commented 8 years ago

This seems intermittent -- re-running the installation I have no issues.

fodma1 commented 7 years ago

Is this solved? I just ran into this issue on gitlab-ci.

npm ERR! Linux 4.7.3-coreos-r2
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
DenislavD commented 7 years ago

For me the problem was not having bzip2 installed sudo yum install bzip2

manda-pccw commented 7 years ago

@DenislavD It solved my issue!!

rbecheras commented 7 years ago

@DenislavD How did you find that missing bzip2 was the source of the problem for you ?

rbecheras commented 7 years ago

In my case, phantom is required by karma-phantomjs-launcher and I just upgraded node from lts/argon (4.x) to lts/boron (6.x).

So I had to upgrade karma-phantomjs-launcher (from 0.1.4 to 1.0.4) and I got phantomjs v2.1.14 instead 1.x and the issue was fixed.

mecheverria89 commented 7 years ago

sudo apt install nodejs-legacy solved my problem. Thanks @knowgod

EddieOne commented 6 years ago

Not installing with -g global option worked for me.