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 (2015) Developing Express Apps Like a Boss Easily Debug Express (and other node apps)

Nodemon creating Node process that can only be killed using the Windows Task Manager

I can't seem to get Nodemon to work. I have Nodemon 1.8.1 installed, and I am using Windows. The first time I execute the Nodemon app.js command, the server starts successfully. However, the program doesn't detect any changes to source files or automatically restart the server. Also, when I use ctrl + c to kill the server, in the console the process appears to die. Yet, the server is still running and when I visit port 3000 in the browser the server is still running. I can't see the node process running when I use the ps or top commands, and the only way I can kill the server is to use the Windows Task Manager.

**EDIT: It seems to be a general problem with all automatic server restart tools. I installed forever, and it is able to detect changes and auto-restart the server. However, I still have the issue where the process doesn't die, and I can't kill the process unless I use Windows Task Manager.

1 Answer

Pedro Sousa
seal-mask
.a{fill-rule:evenodd;}techdegree
Pedro Sousa
Python Development Techdegree Student 18,546 Points

Hey Chris,

I don't really have a solution for you. But I do kinda use nodemon on windows.

Do you have git bash installed?

At the office we use windows and we use the git bash console (or cygwin would also do...) to run/install/handle everything node.js related in your projects instead of the native command line.

If you do use it, you'll have to reinstall nodemon globally (or everything else that you might have installed globally).

We use nodemon and a couple of gulp watch tasks and usually everything goes smoothly.

Have a nice weekend!

Thank you, installing with Git Bash, Nodemon works to watch files and auto-restart the server. For anyone else interested, Forever also works. Unfortunately, both still keep the server running or blocking the port; the only way to kill process is manually with Windows task manager. But, I am guessing this is just a bug with the Node platform on Windows, because this seems to be issue with every server auto-restart tool.

Pedro Sousa
seal-mask
.a{fill-rule:evenodd;}techdegree
Pedro Sousa
Python Development Techdegree Student 18,546 Points

You are very welcome.

I didn't quite get one thing: with git bash you're still not able to stop the server?

Or does it stop but keeps the port bound?

Pedro Sousa
seal-mask
.a{fill-rule:evenodd;}techdegree
Pedro Sousa
Python Development Techdegree Student 18,546 Points

Oh, also, not even if you do Double Ctrl-C ? Like double clicking... Holding Ctrl, double tap c.

Or, (last try, eheh )

Which version on nodemon are you using? we have 1.8.1. which I'm not sure if there is a newer one, but if there is, maybe it gained some "new random feature"?

Ah yes, with the Double Ctrl+c, I can now get the process to stop. It works in Babun and Git Bash, thank you very much.