Whenever i run nodemon I am getting this error but when i run the same with node it executes perfectly
nodemon test.js
[nodemon] 1.10.2
[nodemon] to restart at any time, enter rs
[nodemon] watching: _._
[nodemon] starting node test.js
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at exports._errnoException (util.js:1036: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)
I had exactly same issue running node v6.7.0 on Ubuntu. The weirdest thing was server was still running even tho I have terminated it! I had to un-install few times without any luck. However I get this line of code from atom which solved my problem: sudo apt-get install build-essential git libgnome-keyring-dev fakeroot rpm ... maybe its newbie thing.
The error was due to missing path variable "C:\Windows\System32" in windows. @deeqoo Thanks anyway.
I have the path variable "C:\Windows\System32" in windows added. I even added it both to the User and System variables but I am still have the same problem??? Any thoughts?
The error message is pretty vague so it is very difficult to find the problem. I have what could be causing this problem in your case but do try reinstalling it. Good luck
The error message was what showed up in the screen. That's all I had to go by. I did try reinstalling it but no luck. What do you think is causing it?
Is the code working on somebody else's PC if yes then their must be problem with the installation and configuration, tell me the version of node mom and nodemon you are using
I also have the same issue although "C:\Windows\System32" has been added to both user and system variables. I am running Node.js 7.4.0 and npm 4.1.2. If I run my application using command node it works fine but if I use command nodemon it throws this error
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn C:\Program Files\nodejs\node.exe 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)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
@MAQ7 I got the same problem
@MAQ7 Then I restart my Computer It's OK now!
@xiehongyang how did u update path? user path and system path all add "C:\Windows\System32" ? like this C:\Windows\System32AppData\Roaming\npm ? 我猜你能看懂中文。
@RifeWang 解决了吗?没有解决把Q留下吧
@xiehongyang 这个问题重启电脑解决了,不过碰到了新的问题
C:>npm config get prefix
C:\Users\usernameAppData\Roaming\npm
C:>set PATH=%PATH%;C:\Users\usernameAppData\Roaming\npm;
C:>nodemon
restart ur computer
Most helpful comment
I also have the same issue although "C:\Windows\System32" has been added to both user and system variables. I am running Node.js 7.4.0 and npm 4.1.2. If I run my application using command node it works fine but if I use command nodemon it throws this error
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn C:\Program Files\nodejs\node.exe 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)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3