无法在节点js上使用摩卡运行PhantomJS
我试图用这些参数运行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。
任何谷歌search没有帮助,我只是不知道该怎么办。 所有我以前做的,只是安装节点和mocha-phantomjs
谁能帮我?
我在一台Windows机器上看到了这个错误,并通过将phantomjs可执行文件复制到node.js文件夹中解决了这个问题。
确保phantomjs可执行文件位于PATH中,或者phantomjs可执行文件位于node.js文件夹中。
在Windows上的另一个选项,这是稍微更清洁:
下载Phantomjs 。 解压zip的地方( c:\dev\phantom
或其他),并将其添加到您的path。
使用npm全局安装mocha-phantomjs:
npm install -g mocha-phantomjs
而且你应该全部设置。