nodemon - app crashed - waiting for file changes before starting
Issue : app crashed - waiting for file changes before starting...
There could be different reasons:
1. Running node in background
pkill -f node
Worked in Mac OS ,did not work in Microsoft.
2.Server.js and package.json are not in same folder . Check it .
check package.json
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon Server.js"
}
In the terminal using the below command to kill the existing running port and restart your service.
killall -9 node
or to kill a particular port instead of all
sudo lsof -i :3000 //replace 3000 with your port number
sudo kill -9 31363 // replace 31363 with your PID
for windows users, go to the task manager and then find for node.js server-side javascript, and end task on the process. then try again with your command.
This is happening because of all the running server processes in the background. So all you need to do is stop them from the terminal.
Quick trick
FOR LINUX
Kill them all by running this on terminal:
pkill -f node
And then restart nodemon.
FOR Windows
1. Go to the task manager
2. Then look for Node.js: Server-side JavaScript
3. Then right click on it and End task from the processes.
Then restart the server. It will work fine.