Nodemon App Crashed – Waiting For File Changes Before Starting

The message “nodemon app crashed – waiting for file changes before starting” typically appears when you are using Nodemon to run a Node.js application, and the application crashes for some reason:

  1. Run Numerous Node.js Processes
  2. Code-Related Issues
  3. Incorrect File Path
  4. Database Connectivity Problems

How to fix [nodemon] app crashed – waiting for file changes before starting…

Here are some solutions to fix this error:

Method 1: Kill All Node.js Processes on macOS and Linux

There may be multiple processes running simultaneously in the background, which may cause conflicts and generate errors.

For macOS and ubuntu Linux users, access the bash terminal and execute the below given command.

# for macOS and Ubuntu Linux

pkill -f node

If you found any issue while running the above given command. So, you can try to run the command prefixed with sudo.

# for macOS and Ubuntu Linux

sudo pkill -f node

Restart your nodemon server by using the following command:

npx nodemon server.js

Or if you have installed nodeman globally, you can use the following command:

nodemon server.js

Method 2: Kill All Node.js Processes on Windows

Below are two ways to Kill/Stop/Terminate all Node.js processes on Windows.

Using Task Manager

  • Press Ctrl + Shift + Esc to open Task Manager.
  • In the “Processes” tab, find any processes related to Node.js (e.g., node.exe).
  • Select the processes and click on “End Task” or “End Process.”

Using Command Prompt

  1. Open the Command Prompt or PowerShell.
  2. Use the following command to list all Node.js processes:
    • tasklist | find “node.exe”
  3. To terminate a Node.js process, use the following command, replacing <PID> with the actual Process ID:
    • taskkill /F /PID

Restart your nodemon server by using the following command:

npx nodemon server.js

Or if you have installed nodeman globally, you can use the following command:

nodemon server.js

Method 3: Set Incorrect File Path

If package.json and server.js files are not in the same directory, the error will occur, you can set the path of your package.json and server.js or app.js like this:

"scripts": {
  "dev": "nodemon server.js",
}

Or if your server.js or app.js file is a directory then you have to set the path like this.

"scripts": {
  "dev": "nodemon ./app/server.js"
},

Method 4: Database Connectivity Problems

If your database server is down for some reason, this error can also occur.

Method 5: An alternative command to fix

The alternative nodemon command to fix nodemon crash error is as follows:

nodemon --exitcrash

Conclusion

That’s it; you have learned some ways to fix error “[nodemon] app crashed – waiting for file changes before starting in windows, linux and mac system.

Recommended Tutorials

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *