Nodemon keeps restarting endlessly if a file has been changed #11

ramseydsilva opened this Issue Feb 10, 2011 · 20 comments


5 participants

My platform is ubuntu:

Linux Ubuntu-1010-maverick-64-minimal 2.6.35-25-server #44-Ubuntu SMP Fri Jan 21 19:09:14 UTC 2011 x86_64 GNU/Linux

Node version 0.2.6

Nodemon version 0.2.0

Not sure if this is a bug, but any suggestion is appreciated.


remy commented Feb 10, 2011

Any chance you could provide a sample script so I can replicate the issue.

Obviously that's not normal behaviour!

Here is my hello_world.js file:
Here is the output from shell when running nodemon:

The recurring restart problem happens mostly when starting nodemon. Sometimes nodemon starts ok, but the recurring problem happens when the file has been edited.


ghost commented Feb 11, 2011

I had situation like this before. I have server with nodemon. And I change files through connection on ssh. And because on server and on PC different Time Zone file .monitor always was in future time.

Or, if it's not your situation please give result of command "ls -la" in working directory when this happen.

Thanks for the reply. I will test this. But you are probably right as I am located in Toronto and server is located in Germany. Is there a remedy for the problem?

I just tested this and it is definitely the case! I will see what I can do to sync my ftp software and the server time. Thanks again.


ghost commented Feb 13, 2011

@ramseydsilva We can ask @remy for add option to nodemon like "timechange=+2" than nodemon can save file and than change "edit time" +2 hour.

@remy if you have not any time for this but think that is nice, than tell me and I can write this option. But now after many years of life with python - my javascript code is a little ugly :)


remy commented Feb 14, 2011

@presidentua I'd like to avoid adding some kind of arguments to tweak the behaviour, and rather try to fix the root cause of the problem you're seeing.

I've been considering moving nodemon to use - but looking at your sample code - I'm not totally sure that'll fix it.

Also, can you try testing with nodemon version 0.1.8 - that was the version before I made the fix for node v0.3.8. It might be that...

Thanks for hanging in there!


ghost commented Feb 14, 2011

Now I fully agree with you. Code of Nodemon is really clear and nice with "find" command.

About this case I just change my local time to equal server time :)

Remy, thx for Nodemon! :)


remy commented May 1, 2011

I know it's been a while, but are you still seeing this issue - or rather: are you still able to replicate this issue? If so, I think I may have a fix.

@remy remy closed this in 7e3a9e6 May 1, 2011

I had this issue and fixed it by correcting the timestamps of the files in question with touch *.

tapsboy commented Dec 11, 2014

@graysonc Thanks.

nodemon app.js was working fine but nodemon -L app.js was continuously restarting. touch * worked for me


remy commented Dec 11, 2014

@tapsboy can you share what your working environment is?

tapsboy commented Dec 11, 2014

OS X host with Vagrant Virtualbox based Ubuntu Guest.

When files are edited on OS X, nodemon running on my VM doesn't restart the app, unless I use -L, which worked fine, but after a day or two, it went in an endless restart cycle till I ran touch *. Running nodemon without -L was not causing the endless cycle, but is unusable for me

That said, I do know that suspended/halted Vagrant machines fall behind on system time unless ntpd'ed back, if that is related anyhow to the above problem.


remy commented Dec 11, 2014

@tapsboy two extra questions:

  1. Which platform are you running nodemon, on the host machine or the virtual machine?
  2. Which platform are you changing the files, on the host machine or the virtual machine?

tapsboy commented Dec 11, 2014

  1. I am running nodemon on Linux VM
  2. Editing files using Sublime on OS X

I have the exact same issue. Server now restarts 2 to 4 times (random) after running sudo touch ./
I am running nodemon on a Vagrant puphpet/debian75-x64 VM and editing files using PHPStorm


remy commented Jan 2, 2015

Can you confirm the time on the VM and the local mac machine? (I'm looking
for time drift)
On 2 Jan 2015 09:23, "Wouter cleymans" wrote:

I have the exact same issue. Server now restarts 2 to 4 times (random)
after running sudo touch ./

Reply to this email directly or view it on GitHub
#11 (comment).

It looks like the problem is gone now. I haven't changed anything on my VM or host os. Probably vagrant reload or restart of host os fixed the issue.

Guest os: mon Jan 5 06:29:04 UTC 2015
Host os: mon 5 jan 2015 07:28:51 CET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment