Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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