This is a very common error, when you start your server with nodemon, you might face this error. So, what this comes? and What is the solution? let's get started.
Reasons & Solutions:
Maybe your PC running several processes in the Background. So you need to stop all the node process that are running.
Kill them all by running this on terminal :
pkill -f 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
and then restart nodemon.
Server.js and package.json are not in the same folder.
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon Server.js"
You have written wrong code in your any of the file. So for that make sure you didn’t miss any JS syntax. If you did wrong code, here I’m talking about syntax error (not logic), then your nodemon will not start.