问题
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.
回答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.
来源:https://stackoverflow.com/questions/48505213/nodemon-restart-twice-when-change-is-made