Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightmare will not run on a linux ubuntu AWS instance because of electron #534

Closed
mwiegant opened this issue Mar 13, 2016 · 8 comments
Closed

Comments

@mwiegant
Copy link

My team and I are developing an application that monitors our other servers so we can be the first to know when a server goes down. We've used nightmare to achieve this, and it's really reliable.

.....That is, it's really reliable on our development machines and mac minis in our office. We tried to upload our code to an AWS instance running ubuntu 14.04.3 and had no success. After some research, we discovered that electron was the problem. For whatever reason, electron-prebuilt does not come with the right stuff to be run off of ubuntu and work as expected.

Because electron does not work, we suspect the headless browser does not get created, and therefore tests that we run fail silently. No errors are thrown, but we can see that as soon as the first test is hit no further progress is made and during the next testing cycle the first test is hit again before stopping and waiting until another testing cycle begins.

Is there a way around this? Maybe a different version of electron can be used? Has anyone else had problems running nightmare on an AWS instance, or been able to get nightmare working on one?

@inversion
Copy link
Contributor

You can use Xvfb (virtual framebuffer). See #224 (comment)

@mwiegant
Copy link
Author

If I absolutely cannot get zombiejs to work, which is what I am now trying to use, I will go back and try your suggestion. It sounds like the guys who were participating in your linked thread were having to try some very involved processes which is a red flag for me.

Thanks for taking the time to reply,

@inversion
Copy link
Contributor

I've had success on Ubuntu 14.04 Server from installing the prerequisite packages (see the Dockerfile in the linked comment) and just running node with xvfb-run node ....

@stephenmathieson
Copy link
Contributor

Xvfb is how we use Nightmare in-house. it's not nearly as complicated as its been made out to be either. I can help you get it setup if you like @mwiegant

@stephenmathieson
Copy link
Contributor

linking #421 due to the underlying hidden failure here

@justinmchase
Copy link
Contributor

I have gotten it working on travis-ci using this script:

sudo: false
language: node_js
node_js:
  - "stable"

addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - gcc-4.8
    - g++-4.8
    - xvfb

before_install:
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- export CC=`which gcc-4.8`
- export CXX=`which g++-4.8`
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc

I'm pretty sure that travis is just using linux on AWS

@lukebussey
Copy link

I was able to get my tests running by prefixing npm with xvfb-run. E.g.

$ xvfb-run npm test

@rosshinkley
Copy link
Contributor

I believe this is a duplicate of #224, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants