How do I solve "Server terminated early with status 127" when running node.js on Linux?
In my case I was missing a Java Runtime environment (JRE). I'm running e2e tests with Selenium in a Debian-based docker image, hence apt-get install default-jre
did the trick for me. It's a pity selenium doesn't give a more useful error message in this case.
As suggested by other answers, the error message means you have unmet dependencies.
In my case of selenium e2e test, fixes are:
apt-get install default-jre
as mentioned by @Johannesapt-get -f install
for a fix installapt-get install chromium-browser
Make sure to install the correct version of chrome related to your chromedriver, e.g. chrome 60-62 for chromedriver 2.33- Config webdriver to start chrome in 'headless' mode, as to avoid other unnecessary dependencies. In node it looks like:
const options = new chromeDriver.Options(); options.addArguments( 'headless', 'disable-gpu', ); new webdriver.Builder() .forBrowser('chrome') .setChromeOptions(options) .build();
I had a similar issue where it was missing a shared library that I solved by symlinking libnss3.so:
ln -s /usr/lib/x86_64-linux-gnu/libnss3.so /usr/lib/libnss3.so
If the first directory doesn't work for you, find with:
find /usr/lib/ -name libnss3*
ORfind /usr/lib64/ -name libnss3*
and replace accordingly.
It might also require an update, so try:yum update nss