Nodemon is a utility that monitors for changes in your Node.js application files and automatically restarts the server, streamlining the development workflow. It acts as a wrapper for your Node.js application, requiring no code changes. The current stable version is 3.1.14, and it maintains an active release cadence, primarily issuing bug fixes and type definition updates.
npm install nodemonVerified import paths — ran on the pinned version, not inferred.
This demonstrates how to set up `nodemon` as a development dependency in a `package.json` file and run a simple Express application. When you run `npm run dev`, nodemon will start the server and automatically restart it whenever `src/index.js` (or other watched files) change. The server will display a changing timestamp on each reload.
Upgrade to nodemon v3.1.14 or newer to ensure stable file watching on Windows.
For project-specific development, prefer a local installation (`npm install --save-dev nodemon`) and run it via `npx nodemon` or an `npm run` script. This ensures consistent versions across developers and environments.
Be aware of the configuration hierarchy. If a setting isn't working, check if it's being overridden by a more specific configuration source.
This is expected behavior for scripts that aren't long-running servers. If you expect a script to stay alive, ensure it has an active process (e.g., an HTTP server listening). If you need to manually restart, type `rs` and press enter in the terminal running nodemon.
Customize `watch` and `ignore` options in your `nodemon.json` or via command-line arguments to precisely control which files and directories nodemon monitors. For example, `nodemon --ignore 'dist/'` or `nodemon --watch 'src/'`.
Upgrade to nodemon v3.1.7 or newer to benefit from improved TypeScript types and ES Module export definitions, ensuring better type checking and module interoperability.
If installed locally (`npm install --save-dev nodemon`), run it using `npx nodemon` or define a script in `package.json` like `"dev": "nodemon index.js"`. Alternatively, install it globally: `npm install -g nodemon`.
If installed locally (`npm install --save-dev nodemon`), run it using `npx nodemon` or define a script in `package.json` like `"dev": "nodemon index.js"`. Alternatively, install it globally: `npm install -g nodemon`.
Review the error output immediately preceding this message (it will be from your application, not nodemon) to identify and fix the bug in your code. Nodemon is simply reporting that your application failed.
This is often not an error, but expected behavior. Nodemon will restart the application if any monitored files change. If your application is a server, ensure it's continuously listening for requests, otherwise it will exit cleanly.
Double-check the file path. Ensure it's relative to where you're running the `nodemon` command, or provide an absolute path. For example, `nodemon ./src/app.js`.
No dependency data recorded yet.