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

Unable to start nodemon after installing: command not found: nodemon

I ran npm install -g nodemon as shown in the video but when I try to start it with nodemon I get this error:

command not found: nodemon

I also tried sudo npm install -g nodemon with no luck either.

2 Answers

I'm simply using nodemon since I have

"main": "app.js",

defined in my package.json file.

I tried with nodemon app.js but I still get the same error.

Hunter Phillips
Hunter Phillips
9,310 Points

For nodemon to work, in my case, 'app.js' is inside of 'src' so I needed

"main": "src/app.js",
Stephan Olsen
Stephan Olsen
6,650 Points

Try to see if it is installed by using:

npm view nodemon version

Hi Stephan,

Thanks for the reply. When I run the above command I get 1.12.0.

Stephan Olsen
Stephan Olsen
6,650 Points

What is the exact command you're using? When you use nodemon, you need to specify the entry point. So it should be something like

nodemon app