2

I am using nodemon in order to restart the app when change is made. It works good however it restart two times and thus sometimes it is a bit busy to read data returned from server (like console.log) since its reloaded twice.

I am talking about something like this:

[nodemon] starting `node app.js`
Connected to db and listening on port 8080
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
Connected to db and listening on port 8080

I am working with Atom IDE.

If this question is missing information, please comment and I will update in case its not fully informative.

Thank you for support.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Raz
  • 1,910
  • 1
  • 15
  • 28

2 Answers2

2

The solution that worked for me was adding the -L flag. nodemon -L fileName.js

Krish Garg
  • 73
  • 2
  • 6
1

Possible Solution:

I would start by looking into the set of files/directories nodemon is watching. It may be currently configured to watch two different server files which is why it would restart twice for a single file change. If this is true for you, the solution is as simple as changing your config in order to manage only one extension.

Katie Mary
  • 82
  • 3