{"id":10407,"library":"nodemon","title":"Nodemon","description":"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.","status":"active","version":"3.1.14","language":"javascript","source_language":"en","source_url":"https://github.com/remy/nodemon","tags":["javascript","cli","monitor","development","restart","autoload","reload","terminal","typescript"],"install":[{"cmd":"npm install nodemon","lang":"bash","label":"npm"},{"cmd":"yarn add nodemon","lang":"bash","label":"yarn"},{"cmd":"pnpm add nodemon","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"While primarily a CLI tool, nodemon can be used programmatically. `import` is preferred for modern Node.js projects, especially with type support. CommonJS `require` can also work for older projects, but ESM is generally recommended.","wrong":"const nodemon = require('nodemon');","symbol":"nodemon","correct":"import nodemon from 'nodemon';"},{"note":"Specific functions like `restart` might be exposed as named exports. Check the official API documentation for all available programmatic exports. Attempting to destructure `restart` directly from the default export `nodemon` will likely fail.","wrong":"import nodemon, { restart } from 'nodemon';","symbol":"restart","correct":"import { restart } from 'nodemon';"},{"note":"Nodemon is most commonly used as a command-line tool. If installed locally, use `npx nodemon` or define it in your `package.json` scripts. Importing it without assigning to a variable in module code has no effect.","wrong":"import 'nodemon';","symbol":"Nodemon CLI","correct":"npx nodemon my-app.js"}],"quickstart":{"code":"{\n  \"name\": \"my-node-app\",\n  \"version\": \"1.0.0\",\n  \"description\": \"My sample app\",\n  \"main\": \"src/index.js\",\n  \"scripts\": {\n    \"dev\": \"nodemon src/index.js\",\n    \"start\": \"node src/index.js\"\n  },\n  \"devDependencies\": {\n    \"nodemon\": \"^3.0.0\"\n  }\n}\n\n// src/index.js\nconst express = require('express');\nconst app = express();\nconst PORT = process.env.PORT ?? 3000;\n\napp.get('/', (req, res) => {\n  res.send('Hello from Nodemon! Last updated: ' + new Date().toLocaleTimeString());\n});\n\napp.listen(PORT, () => {\n  console.log(`Server running on http://localhost:${PORT}`);\n});\n","lang":"javascript","description":"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."},"warnings":[{"fix":"Upgrade to nodemon v3.1.14 or newer to ensure stable file watching on Windows.","message":"Nodemon's file watching might not work as expected on Windows in versions prior to 3.1.14.","severity":"gotcha","affected_versions":"<3.1.14"},{"fix":"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.","message":"When installing nodemon, choose between global (`npm install -g nodemon`) or local (`npm install --save-dev nodemon`). Global installations add `nodemon` to your system path, while local installations require `npx nodemon` or a `package.json` script to run.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Be aware of the configuration hierarchy. If a setting isn't working, check if it's being overridden by a more specific configuration source.","message":"Nodemon respects `nodemon.json` configuration files (local and global) and command-line arguments. Command-line arguments always take precedence over local config, which in turn overrides global config.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"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.","message":"If your Node.js script exits cleanly, nodemon will automatically restart it only if file changes are detected. It will not keep the process alive indefinitely if the script finishes its execution.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"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/'`.","message":"Nodemon uses default ignore patterns (e.g., `.git`, `node_modules`). If files you expect to be watched are ignored, or if too many files are watched, performance can suffer.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"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.","message":"Nodemon versions prior to 3.1.7 might have had less robust TypeScript type definitions, especially for ES Module exports.","severity":"breaking","affected_versions":"<3.1.7"}],"env_vars":null,"search_vec":"'3.1.14':42 'act':25 'activ':47 'applic':13,32 'autoload':63 'automat':16 'bug':52 'cadenc':49 'chang':9,36 'cli':59 'code':35 'current':38 'definit':56 'develop':22,61 'file':14 'fix':53 'issu':51 'javascript':58 'maintain':45 'monitor':7,60 'node.js':12,31 'nodemon':1,2 'primarili':50 'releas':48 'reload':64 'requir':33 'restart':17,62 'server':19 'stabl':39 'streamlin':20 'termin':65 'type':55 'typescript':66 'updat':57 'util':5 'version':40 'workflow':23 'wrapper':28","created_at":"2026-04-18T08:58:38.574418+00:00","updated_at":"2026-04-19T04:49:35.458422+00:00","problems":[{"fix":"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`.","cause":"Nodemon is not installed globally or is not in your system's PATH, and `npx` is not being used.","error":"'nodemon' is not recognized as an internal or external command, operable program or batch file."},{"fix":"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`.","cause":"Nodemon is not installed globally or is not in your system's PATH, and `npx` is not being used.","error":"nodemon: command not found"},{"fix":"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.","cause":"Your Node.js application encountered an unhandled error and crashed.","error":"[nodemon] app crashed - waiting for file changes before starting..."},{"fix":"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.","cause":"Your Node.js application exited successfully (e.g., a script completed its task, or a server gracefully shut down).","error":"[nodemon] clean exit - waiting for changes before restart"},{"fix":"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`.","cause":"The path provided to nodemon for your application's entry point is incorrect or the file doesn't exist.","error":"Error: Cannot find module 'path/to/your/script.js'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.1.2","cli_name":"nodemon","cli_version":null,"type":"library","homepage":"https://nodemon.io","github":"https://github.com/remy/nodemon","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/nodemon","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}