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 trialTrevor Maltbie
Full Stack JavaScript Techdegree Graduate 17,021 PointsNodemon 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?
Trevor Maltbie
Full Stack JavaScript Techdegree Graduate 17,021 PointsOmri 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
Danny L.
10,837 PointsHey, 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:
- npm i --save-dev nodemon
- 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"
}
}
- make sure to stop any running server you have and run npm run devStart (or whatever you called it)
- that should work :)
Shelley Cucinotta
7,014 PointsThank you that helped me as well.
Omri Marebera
31 PointsOmri Marebera
31 Pointsfirst uninstall nodemon then sudo npm install -g --force nodemon