I am also having the same issue on a Windows Server 2012.
My software versions are:
phantomJs: 2-0-0-windows
casperJs: 1-0-4
I have set the PATH environment variable to include E:\phantomJs;E:\phantomJS\bin;E\casperJs\batchbin\
I have created a sample.js file, as follows:
phantom.casperPath = 'E:\\CasperJs';
phantom.injectJs(phantom.casperPath + '\\bin\\bootstrap.js');
var casper = require('casper').create();
casper.start('http://casperjs.org/', function() {
this.echo(this.getTitle());
});
casper.thenOpen('http://phantomjs.org', function() {
this.echo(this.getTitle());
});
casper.run();
When I run the following command:
> phantomjs sample.js
I get the following error:
E:\CasperJs\bin\bootstrap.js:48 in global code
I have also tried running the sample.js using casperjs (as opposed to phantomjs). That is:
> casperjs sample.js
I get the following error:
Couldn't find nor compute phantom.casperPath, exiting.
E:\CasperJs\batchbin\..\bin\bootstrap.js:241 in loadCasper
Can anyone assist? I'm burning hours on this and not getting very far.
Thanks