streetlight
streetlight

Reputation: 5968

PhantomJS Crash - Exit Code 126

I'm getting a strange issue when trying to run phantomJS in my workflow on a CentOS (64bit) system.

Here is the error it's reporting:

[4mRunning "qunit:all" (qunit) task[24m Testing http://localhost:8000/tests.html 

Running PhantomJS...[31mERROR[39m
[31m>> [39m/home/jenkins/jenkins/workspace/nick_node_te/web-client/client/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: /home/jenkins/jenkins/workspace/nick_node_te/web-client/client/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: cannot execute binary file 0 [ '/home/jenkins/jenkins/workspace/nick_node_te/web-client/client/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: /home/jenkins/jenkins/workspace/nick_node_te/web-client/client/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: cannot execute binary file' ]

[33mWarning: PhantomJS exited unexpectedly with exit code 126. Use --force to continue.[39m

[31mAborted due to warnings.[39m

I can't seem to find any good documentation on this type of crash. Is this usual and/or worthy of a bug report?

UPDATE:

These are the permissions on my file:

-rwxr-x--x. 1 root root 11308856 Sep 26 12:39 phantomjs

Upvotes: 6

Views: 5236

Answers (1)

EhevuTov
EhevuTov

Reputation: 20463

Sounds like it's not built for the platform you're trying to run it on. Make sure to delete your node_modules directory and do a fresh npm install when you clone your repository to a fresh platform. It's currently bad practice to include your node_nodules dir in with your source control. Just keep your package.json file maintained well and do a npm install or npm update for each repo clone. Also, add node_modules/ to your .gitignore file if you're using git so you don't have to worry about accidently including it when you add changes and commit.

Upvotes: 12

Related Questions