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
To fix the ‘nodemon command is not recognized in terminal for node js server’ error, we can install nodemon locally or install it locally and add a script into package.json to run the local version. To install it locally, we can run: npm install -g nodemon with NPM or: yarn global add nodemon with Yarn. And to add a local version, we run:
nodemon : The term 'nodemon' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. and your nodemon will start working properly.
nodemon version turned into 2.0.14-alpha.1 with npm i nodemon@debug. Confirming with debug mode on Windows 10 + VSCode + PowerShell.
Install nodemon globally: C:\>npm install -g nodemon Get prefix: C:\>npm config get prefix You will get output like following in your console: C:\Users\Family\.node_modules_global Copy it. Set Path.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With