events.js:160 throw er; // Unhandled 'error' event ^

9.4k views Asked by At

I think I did something and broke node. I have tried changing paths, but don't really know what I'm doing and don't want to make the problem worse. Tried uninstalling and reinstalling node all to no avail. Any help or ideas would be great.

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./bin/www start`
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
2

There are 2 answers

0
Ashok Dey On

I was too getting this error.

I read all the answers here in stackoverflow, nothing worked out. A lot of the answers mentions that you go to PATH variable and add "C:\Windows\System32\"

I did that too. It didn't worked out at first. What you have to do is to add the above in the User Variables > PATH > add "C:\Windows\System32\"

After that change the port number and then restart your system.

For me doing the above steps solved the problem.

0
Chris Fox On

Found out I was setting the port twice, once in app.js and once in .bin/www so after commenting one out it now deploys successfully! So i was just being a melon. Hope this helps someone else!