尝试运行示例js文件时,Phantom js返回“无法打开[文件名]" [英] Phantom js returns 'can't open [file name]' when trying to run example js file

查看:62
本文介绍了尝试运行示例js文件时,Phantom js返回“无法打开[文件名]"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:Windows 7,Phantomjs 1.8.0版.

Environment: Windows 7, Phantomjs version 1.8.0.

我尝试运行"examples"文件夹中的任何.js文件,之前安装了Phantom.js,添加了PATH变量的路径,选中了

I try to run any .js file from 'examples' folder, installed Phantom.js before, added path to the PATH variable, checked version like

phantomjs --version

它有效.

但是当我尝试运行

phantomjs examples/version.js

然后显示无法打开version.js"

then get 'Can't open version.js'

我已经检查了文件安全性设置,并像管理员一样运行cmd,但结果仍然相同.

I've checked file security settings and run cmd like administrator, but still the same result.

对于解决此问题的任何帮助,我们将不胜感激.预先感谢.

I'll appreciate any help to solve this issue. Thanks in advance.

推荐答案

遇到同样的麻烦.最后,通过指定phatnomjs可执行文件的绝对路径来解决该问题.

Was having the same trouble. Finally solved it by specifying absolute path to phatnomjs executable.

代替:

phantomjs myjsfile.js

这样做:

/my/absolute/path/to/phantomjs/phantomjs myjsfile.js

我怀疑为其设置PATH会产生相同的效果,但尚未对其进行测试.

I suspect setting up PATH to it will have the same effect, have not tested it though.

这篇关于尝试运行示例js文件时,Phantom js返回“无法打开[文件名]"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆