Can't run PhantomJS with Runit (node: ../deps/uv/src/unix/core.c:431: uv__close: Assertion `fd > -1' failed)

StackOverflow https://stackoverflow.com/questions/23185956

Question

PhantomJS works fine when I run it manually.

But when I run it with runit I get this error in the logs:

node: ../deps/uv/src/unix/core.c:431: uv__close: Assertion `fd > -1' failed.

This is the runit script in /etc/service/phantomjs/run:

#!/bin/sh

cd /
/node_modules/phantomjs/bin/phantomjs --webdriver=8643 >> /var/log/phantomjs.log 2>&1

All the other runit scripts work fine (eg: nginx, postgresql, etc.)

What can be causing this error? Why is PhantomJS behaving differently in a script run by runit?

Was it helpful?

Solution

I was using a local install of phantomJS. Now I tried installing it globally with npm install -g phantomjs, and used the binary it gives you after the install. It works fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top