[英]How can I get CasperJS and PhantomJS to play nicely on Yosemite?
I've been experiencing some issues getting CasperJS and PhantomJS to work on my Mac Pro running Yosemite and was wondering if anyone had any insights? 我一直在遇到一些问题,无法使CasperJS和PhantomJS在运行优胜美地的Mac Pro上运行,并且想知道是否有人有任何见解?
I've npm'd CasperJS globally and downloaded PhantomJS2 to my drive as per the instructions, but I keep getting errors like: 我已经在全球范围内npm's CasperJS并按照说明将PhantomJS2下载到驱动器中,但是仍然出现类似以下错误:
[1] 9409 killed casperjs test/casper/test.js
[1] 9409杀死了casperjs test / casper / test.js
How can I get them to work together? 我如何让他们一起工作?
This is a tricky issue and the solution will involve going round the houses a little bit, but this is what I've found works: 这是一个棘手的问题,解决方案将涉及到绕房子一点,但这是我发现的有效方法:
1) Use the instructions from the CasperJS documentation to clone the repository from GitHub: 1) 使用CasperJS文档中的说明从GitHub复制存储库:
$ git clone git://github.com/n1k0/casperjs.git
$ cd casperjs
$ ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs
2) Download this patched copy Mac copy of PhantomJS from GitHub and unzip it somewhere convenient. 2) 从GitHub下载此补丁副本的PhantomJS Mac副本,并将其解压缩到方便的地方。 I added mine to a folder inside my app test folder as I only need it for that app, but you can put it anywhere.
我在我的应用程序测试文件夹中的文件夹中添加了我的文件夹,因为我只需要该应用程序的文件夹,但是您可以将其放置在任何地方。
3) Export the path of the binary you've just unzipped. 3)导出刚刚解压缩的二进制文件的路径。 In my case it would be something like[1]:
就我而言,它类似于[1]:
export PATH=$PATH:/Users/Andy/Development/app/test/bin
And that should do the trick. 这应该可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.