Installing dependencies
sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \
libnotify-dev libgnome-keyring-dev libgconf2-dev \
libasound2-dev libcap-dev libcups2-dev libxtst-dev \
gcc-multilib g++-multilib \
libgtk2.0-0 libgconf-2-4 \
libasound2 libxtst6 libxss1 libnss3 xvfb \
Download nvm
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
After install nvm, install a node version. For example:
nvm install v5.5.0
Close your terminal and open again.
In project folder run command
npm install [email protected] --save
Add electronPath parameter
var nightmare = Nightmare({
electronPath: require('electron-prebuilt')
});
xvfb-run -a node --harmony <your-script>
DEBUG=nightmare:*,electron:* xvfb-run -a node --harmony <your-script>
OR
DEBUG=nightmare:*,electron:* node --harmony <your-script>
Check if there is not installed library. If you can not find the problem please visit this link
fyi, this Gist is out of date and doesn't work. this, however, does: https://medium.com/@cubxi/running-nightmare-js-on-a-headless-server-95f97d271488