Error running sample code using Spooky.js

I am new to the whole stack of node.js, phantom.js, casper.js and spooky.js. I have everything installed (in Windows), with PATH updated and followed this example:

https://github.com/WaterfallEngineering/SpookyJS

I got this error:

C:\node_modules\spooky>node examples/hello.js

events.js:68
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: Child terminated with non-zero exit code 127
    at Spooky._spawnChild.Spooky._instances.(anonymous function) (C:\node_module
s\spooky\lib\spooky.js:82:17)
    at ChildProcess.EventEmitter.emit (events.js:96:17)
    at Process._handle.onexit (child_process.js:678:10)

Anyone has any clue why and how to fix it? I run casperjs googlelinks.js just fine. But with node.js and spooky.js, it gave me trouble.

This is due to the CasperJS Windows executable being named casperjs.bat instead of casperjs. See this comment on the bug @mike mentioned.

Unfortunately, you'll have to hack around this bug for the moment. I will release a fix for that this week.

This is based on the workaround provided by @mike and @lawnsea, which did lead me to the solution, but were not immediately clear to a beginner like me. The tip from minaki also helped me understand what to do: https://github.com/WaterfallEngineering/SpookyJS/issues/14

INSTALL SPOOKY.JS ON WINDOWS 7 WITH NPM.

I'm using:

  • Win7 64 bit
  • Node v0.10.17
  • CasperJS 1.1.0-DEV
  • PhantomJS 1.9.2
  • Added everything to my $PATH already

Steps:

  • Fresh directory: mkdir spookytest, cd spookytest
  • npm install spooky
  • open spookytest\node_modules\spooky\lib\spooky.js in a text editor
  • Change Line 26 (defaults.child.command) from 'casperjs' to 'casperjs.bat'
  • Change Line 30 (defaults.child.transport) from 'stdio' to 'http'
  • Save and go back to the spookytestdirectory
  • node node_modules/spooky/examples/hello.js

--> Hello, from Spooky the Tuff Little Ghost - Wikipedia, the free encyclopedia