7

I am new to node.js. node is working fine but when I installed the nodemon package, it gives an error: exception in nodemon killing node, even when installed globally.

 22 Jun 13:07:29 - [nodemon] v1.3.7
 22 Jun 13:07:29 - [nodemon] to restart at any time, enter `rs`
 22 Jun 13:07:29 - [nodemon] watching: *.*
 22 Jun 13:07:29 - [nodemon] starting `node server.js`
 exception in nodemon killing node  
 Error: spawn cmd ENOENT
 at exports._errnoException (util.js:746:11)
 at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
 at child_process.js:1144:20
 at process._tickCallback (node.js:355:11)

 ---------------------------------------------------------- 
 If appropriate, please file an error with the output from:
 $ node                     
 C:\Users\username\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.
 js server.js --dump
 At http://github.com/remy/nodemon/issues/new
Avery
  • 2,270
  • 4
  • 33
  • 35
Nag
  • 489
  • 3
  • 6
  • 27

2 Answers2

8

Possible solutions.

1. Permissions

The problem may be in your file permissions. Execute in git bash or from windows to give full permission to the project folder.

$ chmod -R 777 [folder] 

2. Environment Variables

Missing "C:\Windows\System32" in the PATH.

Github issue

3. Reinstall

Altogether remove nodemon using npm and try reinstalling.

npm uninstall -g nodemon

4. Update nodejs

If you have an old version of NodeJS, try updating it. I prefer entirely removing NodeJS and reinstalling it again.

Step by steps to remove NodeJS in windows

Note: Your question may not be rich enough to answer correctly. Please include more information about questions if those didn't work.

Malindu
  • 135
  • 1
  • 12
  • 2
    after unintentional clearing my Windows PATH Variable, the System32 Path was missing. after adding it the spawn cmd error was gone :) – Lusk116 Jul 06 '16 at 06:52
0

Help spawn to locate your nodemon.cmd like this:

var nodemonCmd = (process.platform == 'win32') ? 'node_modules\\.bin\\nodemon.cmd' : 'nodemon'
myApp = spawn(nodemonCmd, ['build/server.bundle']);

Hope it works :)

A_J
  • 1,635
  • 1
  • 18
  • 31