- Versions: node@v22.21.0, darwin@24.6.0
nodemon -v: 3.1.10
- Operating system/terminal environment (powershell, gitshell, etc): macOs, fish shell
- Using Docker? What image: No
- Command you ran:
nodemon <filename>
Expected behaviour
If the target file doesn't exist or can't be resolved, nodemon shouls fail to start (e.g file not found)
Actual behaviour
Nodemon spawns itself infinitely
Steps to reproduce
Have a nodejs project
Remove the main entry point from package.json
Have a start script or similar (npx nodemon file_doesnt_exist.js should also be enough)
npm pkg set scripts.start="nodemon file_doesnt_exist.js"
Run command
Notes
This first occurred after running npx express-generator, which creates a default package.json without a main field. So this probably isn't a contrived setup
If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.
nodemon -v: 3.1.10nodemon <filename>Expected behaviour
If the target file doesn't exist or can't be resolved, nodemon shouls fail to start (e.g file not found)
Actual behaviour
Nodemon spawns itself infinitely
Steps to reproduce
Have a nodejs project
Remove the main entry point from
package.jsonHave a start script or similar (npx nodemon file_doesnt_exist.js should also be enough)
Run command
Notes
This first occurred after running
npx express-generator, which creates a default package.json without amainfield. So this probably isn't a contrived setupIf applicable, please append the
--dumpflag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.