Nodemon Doesn't Restart in Windows Docker Environment

Use nodemon --legacy-watch to poll for file changes instead of listening to file system events.

VirtualBox doesn't pass file system events over the vboxfs share to your Linux VM. If you're using Docker for Windows, it would appear HyperV doesn't propagate file system events either.

As a 2021 side note, Docker for Mac/Windows new GRPCfuse file system for mounting local files into the VM should send file system events across now.


It is simple, according to the doc you must change:

nodemon server.js

to:

nodemon --legacy-watch server.js