在Linux上运行node.js时,如何解决“服务器提前终止状态127”?

我在这个版本的Linux上使用节点5.10.0

[davea@mydevbox mydir]$ uname -a Linux mydevbox.mydomain.com 7.3.8-25.26.amzn1.x86_64 #1 SMP Wed Mar 16 17:15:34 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 

运行我的脚本(“服务器提前终止状态127”)时出现以下错误。 我已经validation,我可以使用“wget”来访问有问题的url,所以我不能告诉我还需要什么来使这个东西工作…

 [davea@mydevbox mydir]$ node myscript.js Validation Complete /home/davea/node_modules/selenium-webdriver/lib/promise.js:654 throw error; ^ Error: Server terminated early with status 127 at Error (native) at /home/davea/node_modules/selenium-webdriver/remote/index.js:242:20 at ManagedPromise.invokeCallback_ (/home/davea/node_modules/selenium-webdriver/lib/promise.js:1343:14) at TaskQueue.execute_ (/home/davea/node_modules/selenium-webdriver/lib/promise.js:2868:14) at TaskQueue.executeNext_ (/home/davea/node_modules/selenium-webdriver/lib/promise.js:2851:21) at /home/davea/node_modules/selenium-webdriver/lib/promise.js:2730:27 at /home/davea/node_modules/selenium-webdriver/lib/promise.js:639:7 at process._tickCallback (internal/process/next_tick.js:103:7) From: Task: WebDriver.createSession() at acquireSession (/home/davea/node_modules/selenium-webdriver/lib/webdriver.js:107:22) at Function.createSession (/home/davea/node_modules/selenium-webdriver/lib/webdriver.js:337:12) at Driver (/home/davea/node_modules/selenium-webdriver/chrome.js:778:38) at Builder.build (/home/davea/node_modules/selenium-webdriver/builder.js:464:16) at Object.<anonymous> (/home/davea/mydir/js/Optimus.js:14:4) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) From: Task: WebDriver.navigate().to(http://localhost:8081/myproject) at Driver.schedule (/home/davea/node_modules/selenium-webdriver/lib/webdriver.js:386:17) at Navigation.to (/home/davea/node_modules/selenium-webdriver/lib/webdriver.js:1029:25) at Driver.get (/home/davea/node_modules/selenium-webdriver/lib/webdriver.js:797:28) at Object.exports.Login.Page (/home/davea/mydir/js/Optimus.js:505:16) at Object.exports.smokeTest (/home/davea/mydir/js/Optimus.js:2442:19) at Object.<anonymous> (/home/davea/mydir/SkyNet.js:13:6) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) 

Solutions Collecting From Web of "在Linux上运行node.js时,如何解决“服务器提前终止状态127”?"

我有一个类似的问题,它缺少一个共享库,我通过symlinking libnss3.so解决:

ln -s /usr/lib/x86_64-linux-gnu/libnss3.so /usr/lib/libnss3.so

如果第一个目录不适用于您,请查找:

find /usr/lib/ -name libnss3*或者find /usr/lib64/ -name libnss3*

并相应地更换。

它可能还需要更新,所以试试: yum update nss

在我的情况下,我错过了Java运行时环境(JRE)。 我在一个基于Debian的docker镜像中运行了e2e的seleniumium测试,因此apt-get install default-jre为我做了一个窍门。 可惜硒在这种情况下并没有给出更有用的错误信息。