Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Express Basics Getting Started with Express Creating a Route with Express

Trevor Maltbie
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Trevor Maltbie
Full Stack JavaScript Techdegree Graduate 17,020 Points

Nodemon returns "command not found"

Running macOS 10.13.6 and installed nodemon 2.0.4

Typing nodemon into the terminal returns: "command not found"

Any idea what I can do?

first uninstall nodemon then sudo npm install -g --force nodemon

Trevor Maltbie
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Trevor Maltbie
Full Stack JavaScript Techdegree Graduate 17,020 Points

Omri Marebera what does --force do?

npm WARN using --force I sure hope you know what you are doing.

even after doing this I still get:

-bash: nodemon: command not found

1 Answer

Daniel L.
Daniel L.
10,837 Points

Hey, so I was having the same problem. I had never used nodemon the way it was demonstrated in the video so I went back and did it the way I was used to using it and it worked.

Here are the steps:

  1. npm i --save-dev nodemon
  2. open up package.json and change the scripts key value as shown here:
{
  "name": "flashcards",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "devStart": "nodemon app.js" //replace whatever the default echo message with something like this. I called it devStart because that's how I learned it from a tutorial but you can call it whatever as long as the property is "nodemon NameOfYourFile.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  },
  "devDependencies": {
    "nodemon": "^2.0.6"
  }
}
  1. make sure to stop any running server you have and run npm run devStart (or whatever you called it)
  2. that should work :)

Thank you that helped me as well.