PhantomJS崩溃 - 退出代码126

时间:2013-09-25 19:46:57

标签: javascript node.js jenkins phantomjs gruntjs

尝试在CentOS(64位)系统的工作流程中运行phantomJS时,我遇到了一个奇怪的问题。

以下是报告的错误:

[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

我似乎无法找到有关此类崩溃的任何好文档。这通常和/或值得一个错误报告吗?

更新:

这些是我文件的权限:

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

1 个答案:

答案 0 :(得分:12)

听起来它不是为你试图运行它的平台而构建的。确保删除node_modules目录,并在将存储库克隆到新平台时重新执行npm install。将您的node_nodules dir包含在源代码管理中目前是不好的做法。只需保持好package.json文件,并为每个repo克隆执行npm installnpm update。另外,如果您使用node_modules/,请将.gitignore添加到git文件中,这样您就不必担心在添加更改和提交时意外包含该文件。