幻影JS崩溃 - 退出代码126

PhantomJS Crash - Exit Code 126

本文关键字:代码 退出 JS 崩溃 幻影      更新时间:2023-09-26

我在尝试在 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

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