SpookyJS example/hello.js fails with "throw er; // Unhandled 'error' event" - node.js

When I run the hello example from SpookyJS, it fails with the following error:
$ node examples/hello.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:998:11)
at Process.ChildProcess._handle.onexit (child_process.js:789:34)
In fact, all examples that I tried result in this error. I'm stuck, as I cannot interpret the error message even when looking into the source code. Do you have any ideas?
(I'm using Ubuntu with phantomjs 1.9.7)

Solution: npm install -g casperjs
I assumed that it is enough to call npm install locally, but casperjs must be in the path. After I installed casperjs globally, the example worked fine.

Related

how to fix 'events.js:180 throw er; // Unhandled 'error' event Error: spawn ls ENOENT

I get the error:
'events.js:180 throw er; // Unhandled 'error' event Error: spawn ls
ENOENT
and tried to fix it using all relevant solutions in Stack Overflow, but I could not get it fixed...
Would you please guide me to a solution?
nmp init
npm install
npm start
npm install express
const cp = require('child_process');
var progs={
list:"ls",
copy:"cpy",
folder:"mkdir"
}
var child=cp.spawn(progs.list);

Error: spawn cmd ENOENT in create-react-app

I installed nodejs and after then when I try to run my previous react app by running yarn start it gives me an error something like this.
Even if I make a new app with create-react-app it gives the same error while trying to start.
nodejs apps are working fine so I think the problem is with create-react-app. I don't know how to fix them.
$ react-scripts start
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
And I have no idea what is wrong. Please help me fix this.
Change react-scripts version in package.json to 2.1.8. It works for me.

Unhandled error event with ionic serve

This is the error
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn C:\Program Files (x86)\nodejs\node.exe ENOENT
at notFoundError (E:\IonicProjects\projectapp\ionic3\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (E:\IonicProjects\projectapp\ionic3\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (E:\IonicProjects\projectapp\ionic3\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
I don't get why this error is happening, I've been working on this project for a while and now only with this project is giving to me this error, I've tested with other project that I had made and it serves OK, I've read about ENOENT but I don't get why I have to add code on my project if NEVER I've changed libraries or something.
Note: I'm runing a Windows 10
I solved this issue by:
1. clearing npm cache , run the following commands:
npm cache clean -f
npm install npm -g
Then:
2. catch the exceptions on your code, it also thrown when there is un-catched exceptions.

React - npm start fails with error

NPM start throwing the following error
events.js:160
throw er; // Unhandled 'error' event
^
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1022:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
I have tried
rm -rf node-modules/
npm install
npm run build
but the error still occurs.
This looks to be a similar issue with the same solution as that for which I answered here
You have to install watchman with brew install watchman.

Node.js SpookyJS: error executing hello.js

I have installed SpookyJS to execute CasperJs commands in Node.js. I Installed it with this command: npm install spooky, I´m using a Centos machine.
the error:
$ node node_modules/spooky/examples/hello.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
Thanks in advance

Resources