Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phantomjs always giving parse error on windows [duplicate]

this might sound like a stupid issue but I can't seem to figure out at all why

I downloaded the windows binary and following the quickstart instructions and tried using the examples, but whatever and whenever I type anything in the console I always get "parse error"

I tried:

phantom hello.js

phantomjs hello.js

and some of the example scripts, and I always get 'parse error'

the hello.js file simply has this

console.log('Hello, world!');

phantom.exit();

I have no clue what's wrong... any help would be appreciated...I'm sure this will turn out to be something stupid so I appreciate your time! thanks

like image 406
roy naufal Avatar asked May 03 '12 18:05

roy naufal


2 Answers

Add 'phantomjs-1.5.0-win32-static' folder path to your system environment variable path and try phantomjs --version in new cmd prompt. If you can able to get the version correctly then you can execute your .js as below

phantomjs hello.js
like image 198
premnathcs Avatar answered Oct 24 '22 18:10

premnathcs


Your shoudnt run the phantomjs.exe file directly. you have to run it from CMD!

like image 3
T.Todua Avatar answered Oct 24 '22 19:10

T.Todua