. Advertisement .
..3..
. Advertisement .
..4..
I get the error [nodemon] app crashed – waiting for file changes before starting.. when running the program
Mongoose: users.insert({ firstname: 'mike', lastname: 'jones', email:'[email protected]', role: 'admin', password: 'mike', _id: ObjectId("57485c16fc11894b96c28057"), created: new Date("Fri, 27 May 2016 14:39:18 GMT"), __v: 0 })
user.save success
node crash
[nodemon] app crashed - waiting for file changes before starting...
Browser console response:
http://localhost:8000/api/users net::ERR_CONNECTION_REFUSED
Does anyone have any suggestions for the problem below: [nodemon] app crashed – waiting for file changes before starting… in the typescript. How to correct it?
The cause: There are 2 reasons of this error:
1. Running node in background
It worked in Mac OS but did not work in Microsoft.
2. Server.js and package.json are not in same folder .
Solution: You need to check package.json by doing:
This is due to all the background server processes. You can simply stop them by closing the terminal.
Quick tip
FOR LINUX
Run this command on your terminal to kill them all:
Then, restart nodemon.
FOR Windows
Next, restart the server. It should work perfectly.