Nodemon Not Working: -bash: nodemon: Command Not Found

Fix “nodemon: command not found” by installing it globally, using npx, or setting the correct PATH. You can also run it as an npm script for convenience.

Summarize with AI

Not enough time? get the key points instantly.

If you’re trying to run nodemon from the terminal and see the error:
“nodemon: command not found”, it usually means the NodeJS package “nodemon” is not installed globally or your terminal can’t find it in your system’s PATH.

Solution 1: Install nodemon Globally

You can install nodemon globally:

npm install -g nodemon

This makes it available system-wide so you can run nodemon from any directory.

Solution 2: Use npx (No Global Install Needed)

If you don’t want a global install:

npx nodemon app.js

This uses the version in your project’s node_modules folder (if installed).

Solution 3: Check Your PATH

Make sure your global npm path is in your system’s PATH. To find it:

npm config get prefix

Make sure the output (e.g., /usr/local/bin) is in your terminal’s PATH variable.

Solution 4: Use nodemon as an NPM Script

Add this to your package.json:

“scripts”: {“dev”: “nodemon app.js”

}

Run with:

npm run dev

Also Read:

Conclusion

Install nodemon globally, use npx, or run it via npm scripts to avoid “command not found” issues in Bash.


Resources

Insights from our engineering leaders.

Our team shares practical insights on the technologies and engineering decisions shaping enterprise software today, grounded in real client work.

NodeJS

Which Company Is Best for Hiring Node.js Developers in the UK?

Node.js helps businesses build backend systems, REST APIs, real-time applications, and SaaS platforms using JavaScript. Developing these solutions requires professionals who understand application architecture, technical…

NodeJS

How to tell if Node.js is installed or not?

To verify Node.js installation, run node -v or node --version. This checks if Node.js is installed and working correctly. Problem Before you run any Node.js…