1

我正在尝试使用这些参数运行 phantomjs:

mocha-phantomjs -s disk-cache=no --ignore-leaks -R xunit tests/index.html

但总是得到这样的回应:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

我使用 ubuntu 13、mocha-phantomjs 3.1.0 和节点 v0.10.15。

任何谷歌搜索都无济于事,我只是不知道该怎么做。我之前所做的只是安装 node 和 mocha-phantomjs

谁能帮我?

4

2 回答 2

2

我在 Windows 机器上看到了这个错误,并通过将 phantomjs 可执行文件复制到 node.js 文件夹来解决它。

确保 phantomjs 可执行文件位于 PATH 中或 phantomjs 可执行文件位于 node.js 文件夹中。

于 2013-08-14T13:35:00.720 回答
0

Windows 上的另一个选项,稍微干净一些:

下载 Phantomjs。在某个地方(或其他地方)解压缩 zipc:\dev\phantom并将其添加到您的路径中。

使用 npm 全局安装 mocha-phantomjs:

npm install -g mocha-phantomjs

你应该准备好了。

于 2013-09-09T20:43:39.020 回答