Home > Back-end >  nodemon app crashed - waiting for file changes before starting cmd
nodemon app crashed - waiting for file changes before starting cmd

Time:06-20

After installing nodemon package i am getting error nodemon app crashed - waiting for file changes before starting when saving files.

CodePudding user response:

This means there is an error somewhere in your code, which is stated above the [nodemon] app crashed error. When this error is fixed, nodemon will restart and run properly.

E.g

console.l()
        ^

TypeError: console.l is not a function // your actual error
    at Object.<anonymous> (.../app.js:53:9) // line of the error in your file (usually)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47
[nodemon] app crashed - waiting for file changes before starting...

CodePudding user response:

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 the 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 the task from the processes.

Then restart the server. It will work fine.

  • Related