Nodemon doesn't restart on file delete
See original GitHub issuenodemon -v
: 2.0.4node -v
: v14.2.0- Operating system/terminal environment: Linux Ubuntu 20.04
- Using Docker? What image: N/A
- Command you ran: N/A
Expected behaviour
According to this issue, Nodemon should restart when a file is deleted as it does when a file is added.
Actual behaviour
Nodemon doesn’t restart at all. I’m unsure if this feature was added at some point and then removed or if this is a problem with my setup but I’ve not been able to get Nodemon to restart on file deletion.
It works just fine when I edit or add files.
Is there a workaround for this?
Steps to reproduce
- Have Nodemon watch your project root:
- Delete a file
- Nodemon doesn’t restart
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Delete doesn't trigger a restart event in nodemon
Is deleting a file not supposed to trigger a restart event? How can I capture a file being deleted? I've tried the following:...
Read more >nodemon not restarting Code Example
nodemon does not restart ... nodemon running but not restart the server on files changes ... Answers related to “nodemon not restarting”.
Read more >Automatically restart Node.js apps with Nodemon
The essential tutorial for Nodemon, a utility for Node.js applications that monitors for changes and automatically restarts the server.
Read more >Automatically Restart Node Apps on File Change with nodemon
Nodemon is an open-source utility package that keeps track of the changes made to your source code and restarts your project server ...
Read more >Initializing a Node Project - Thinkster.io
That means every time we make a change to a file we have to restart our server. Thankfully, there's a tool called nodemon...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I personally think it’s fine for you to not fix it, but you keep bringing up the fact that nobody submitted a PR. Put in the perspective of this repo being 10 years old, I think 24 days is a really small window to give for a PR to be submitted. It’s also possible that people just decided to use something like onchange instead, or in combination (as I did)
@remy Could this issue be solved by adding
here: https://github.com/remy/nodemon/blob/main/lib/monitor/watch.js#L85
It seems to match what chokidar is using: https://github.com/paulmillr/chokidar/blob/master/lib/constants.js#L12