Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error - running spookyjs

I am getting the following error in windows while running spookyjs but code is working in linux.

Error

events.js:85
throw er; // Unhandled 'error' event
        ^
Error: spawn casperjs ENOENT
at exports._errnoException (util.js:746:11
at Process.ChildProcess._handle.onexit (ch
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)

Note:

I have installed all the dependencies and added the PATH varaiables

  1. Phantomjs
  2. Python
  3. casperjs - Installed globally using npm install -g casperjs

In the command prompt casperjs is working

What I have tried:

  1. Installed npm as global using

     npm install -g npm
    
  2. Uninstalled 0.12 and downgraded to 0.10.

  3. Added System variable C:\Windows\System32;.

Any idea or suggestion will be grateful

like image 622
karthick Avatar asked Jul 24 '15 12:07

karthick


2 Answers

spawn is trying to execute the casperjs command, make sure you can execute it from your cmd.exe console. If this is not executing locate the casperjs binary and make sure it's added to the PATH

like image 180
Julián Duque Avatar answered Oct 19 '22 17:10

Julián Duque


Any update? I have the same issue.

Both phantomjs & casperjs are in the PATH and work from cmd.exe. Tried to install it globally too...

I'm running out of options!

EDIT: OK I didn't test this but it makes sense. Apparently spawn can't handle .bat and .cmd files, hence why it does work from cmd.exe but not from spawn when PhantomJS and CasperJS are installed via npm. Installing them manually should work because you'll have phantomjs.exe and casperjs.exe. Gonna try it tonight.

EDIT2: Yep. Works. Install them manually (and put the new path in the PATH variable) and you're good to go.

like image 31
mombul Avatar answered Oct 19 '22 15:10

mombul