How do I solve “Server terminated early with status 127” when running node.js on Linux?

前端 未结 5 1618
悲&欢浪女
悲&欢浪女 2021-01-17 08:27

I’m using node 5.10.0 on this version of Linux

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


        
相关标签:
5条回答
  • 2021-01-17 09:01

    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.

    0 讨论(0)
  • 2021-01-17 09:02

    As suggested by other answers, the error message means you have unmet dependencies.

    In my case of selenium e2e test, fixes are:

    1. apt-get install default-jre as mentioned by @Johannes
    2. apt-get -f install for a fix install
    3. apt-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
    4. 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();

    0 讨论(0)
  • 2021-01-17 09:04

    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* OR find /usr/lib64/ -name libnss3*

    and replace accordingly.

    It might also require an update, so try: yum update nss

    0 讨论(0)
  • 2021-01-17 09:11

    I was using node.js based selenium script and overcome the issue by installing google chrome manually using the command curl https://intoli.com/install-google-chrome.sh | bash

    This worked for me. Please give a try. Thanks.

    0 讨论(0)
  • 2021-01-17 09:20

    I had the same problem. I had different versions of chromedriver and google-chrome-stable package in Ubuntu. I checked the chrome version by google-chrome-stable --version CLI command. And then downloaded the suitable chromedriver from here: http://chromedriver.storage.googleapis.com/index.html. Copped it into /usr/bin/local and set 777 permissions to the file. Everything started working.

    0 讨论(0)
提交回复
热议问题