app crashed - waiting for file changes before starting... nodemon crash state restart behavior
0 reputation · 21 Mar 2025, 09:05 UTC
Nodemon is a development-time wrapper that restarts a Node process when watched files change. A documented failure condition is the crash state entered when the child process exits with a non-zero code. In that state restarts are suspended until a watched file changes, which differs from the behavior on a clean exit.
Restart throttling via delay batches rapid successive saves, and watch scope can be narrowed with --watch, --ignore and --ext. The default recursive watch can cause unintended restarts from log or temporary writes.
The crash-loop policy remains an open design point. There is no built-in backoff for repeated crashes, so a process that crashes on every start will restart immediately on each file change.
Does nodemon expose a configurable backoff or crash count threshold for the crash state? How is the distinction between crash and clean exit determined for restart decisions? What is the intended interaction between delay configuration and the crash-suspended state?