linux - 无法使用 Runit 运行 PhantomJS( Node : . ./deps/uv/src/unix/core.c:431: uv__close: 断言 `fd > -1' 失败)

标签 linux node.js phantomjs sh runit

当我手动运行时,PhantomJS 工作正常。

但是当我用 runit 运行它时我在日志中收到此错误:

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

这是 /etc/service/phantomjs/run 中的 runit 脚本:

#!/bin/sh

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

所有其他 runit 脚本都可以正常工作(例如:nginx、postgresql 等)

什么可能导致此错误?为什么 PhantomJS 在 runit 运行的脚本中表现不同?

最佳答案

我使用的是本地安装的 phantomJS。现在我尝试使用 npm install -g phantomjs 进行全局安装,并使用安装后提供的二进制文件。效果很好。

关于linux - 无法使用 Runit 运行 PhantomJS( Node : . ./deps/uv/src/unix/core.c:431: uv__close: 断言 `fd > -1' 失败),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23185956/

相关文章:

linux - Bash 脚本杀死所有程序并在一分钟后重新启动它们

javascript - 无法使用 selenium webdriver 在 nightwatch.js 中执行按钮单击

javascript - 使用node js和react js的文件加载问题

phantomjs - 在指定路径找不到 phantomjs

python - 使用英特尔编译器和 MKL 构建 Numpy - CentOS 7

javascript - 在 Linux 16.04 中使用 create-react-app 创建应用程序失败

python , Selenium : unable to get raw html from javascript

javascript - 如何使用 CasperJS 与自定义选择框交互?

linux - 循环附加到 tar 文件

node.js - 为什么我的函数在 storage.single 中被调用两次?