Skip to content
Advertisement

How do I fix a “nodemon app crashed” error message?

I have just worked through chapter 2 of the book Full Stack React Projects, Second Edition.

When I type into the Terminal yarn development to check my code, I get this error message:

JavaScript

I have tried the following solutions:

  1. https://stackoverflow.com/a/54450694/14537132
  2. https://stackoverflow.com/a/63298885/14537132
  3. Deleting nodemone.json and re-creating the file
  4. Deleting the node modules file & re-installing it

How do I fix this?

Advertisement

Answer

Deleting the node modules file won’t solve your issue since the problem according to the error log isn’t with any of the packages used in your app. Your app issue originates most likely from your server.js file as seen in your error log

JavaScript

what I can see is that the crash happens when nodejs tries to access the static files of your app which you declared in your server.js file on line 23.

You did not initialize the app variable before you used it on line 23. You would need to do something like this:

JavaScript

Also, check if the “dist” file path is correct.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement