Casperjs – Couldn’t find nor compute phantom.casperPath, exiting


I just installed phantomjs v2.0 on a Windows box, add its location to its path, download casperjs v1.0.4, extract to root folder on C: drive, rename the folder to casperjs, add casperjs\batchbin to its path (not casperjs\bin as suggested in its documentation), invoking casperjs –version on the command line, but then getting this error message

Couldn’t find nor compute phantom.casperPath, exiting

googling for a minutes, I got the solution here https://github.com/n1k0/casperjs/issues/1150

just add these 4 lines code into casperjs\bin\bootstrap.js file


var system = require('system');
var argsdeprecated = system.args;
argsdeprecated.shift();
phantom.args = argsdeprecated;