Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: spawn ENOENT when trying to run on windows #61

Open
bgaborg opened this issue Jul 24, 2014 · 1 comment
Open

Fatal error: spawn ENOENT when trying to run on windows #61

bgaborg opened this issue Jul 24, 2014 · 1 comment

Comments

@bgaborg
Copy link

bgaborg commented Jul 24, 2014

I'm getting

Fatal error: spawn ENOENT
error when running on windows.

I think the executable bat/exe file not found by node.

@bgaborg
Copy link
Author

bgaborg commented Jul 24, 2014

The error is that there's a missing executable in node_modules\grunt-casperjs - while on linux there's a symlink for node_modules\grunt-casperjs\lib\casperjs\casperjs-1.0.3\bin\casperjs executable, in windows it will not be available.

The fix is to handle this in windows: instead of creating a symlink to bin\casperjs, one have to create a bat file pointing at grunt-casperjs\lib\casperjs\casperjs-*\batchbin\casperjs.bat with all given arguments.

In install.js there's a

    if (process.platform != 'win32') {
        var pathToCommand = path.join(libPath, 'casperjs-' + version, 'bin', 'casperjs');
        fs.symlinkSync(pathToCommand, './casperjs');
        var stat = fs.statSync(pathToCommand);
        if (!(stat.mode & 64)) {
            fs.chmodSync(pathToCommand, '755')
        }
    }

but there is no else branch for providing compatibility for windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant