Closed rbonvall closed 10 years ago
Try version 0.3.1. This should be resolved. I still had a global version sitting around, removed that and was able to reproduce. Fixed in 0.3.1 exported casperjs bin at the top level
I upgraded from 0.3.0 to 0.3.1 and it worked. Thanks!
If casperjs is already installed locally the installation of this package will not pull casperjs into the packages node_modules folder so you'll still get the error.
@timjacobi I hit that same issue, fixed by checking for installed casper in the outer node_modules if it's not inside grunt-casper https://github.com/iamchrismiller/grunt-casper/blob/master/tasks/lib/casper.js#L63 changed to
if (!fs.existsSync(casperBin)) {
//swap to the location outside and check if it's installed locally there
localModulesPath = path.resolve(__dirname, '../../..');
casperBin = localModulesPath + casperBinaryPath;
if (!fs.existsSync(casperBin)) {
grunt.log.error("CasperJS Binary Not Found, try `npm install`");
return next(true);
}
}
How about a pull request? :)
I encountered the same issue with last version (0.3.8).
Here is the pull request to fix it @iamchrismiller : https://github.com/iamchrismiller/grunt-casper/pull/44
It just try to find the casperjs bin in the project local modules if not found locally in grunt-casper. Thanks to @abeadam for the fix :)
I'm trying to use grunt-casper in a project. I installed it the common way:
npm install grunt-casper --save-dev
.I have the following configuration in my
Gruntfile.coffee
:When I run
grunt functional
, I get the following output:I added a line manually in
tasks/lib/casper.js
to printpath.resolve(casperBin)
, and the path I got is just wrong. It prints:while the binary can be found in the following paths:
The binary is searched in a path relative to the project root. It works when the project is grunt-casper, but not when the latter is just a dependency for another project.
Is this like this by design? Was it working correctly for all of you?