mocha-phantomjs: Getting the Error: spawn ENOENT on Windows7 x64. with node v0.10.5

Hi,

Our mocha tests ran fine on OSX using mocha-phantomjs (latest version) using node v0.10.5 but on Windows7 (x64) i get the following error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:975:11)
    at Process.ChildProcess._handle.onexit (child_process.js:766:34)

I’ve setup test files to reproduce the error at https://gist.github.com/theanimal666/5538827

Here the details of my environment:

  • Windows7 x64 (fully patched)
  • Node.Js 0.10.5
  • PhantomJS 1.9.0
  • mocha 1.9.0

I also tried different shells (git bash, cmd, powershell), the error is always the same. In Chrome the tests run fine.

regards, Chris

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 15

Most upvoted comments

Hi,

i’m also using win 8 and my phantomjs.exe is located in C:/Users/shawnlim/AppData/Roaming/npm/node_modules/phantomjs/lib/phantom/phantomjs.exe

Copy that phantomjs.exe, go all the way back to [the path to]/Roaming/npm/ and paste it in that folder. Then it works for me.