Nodemon: Nodemon restarts multiple times

Created on 23 May 2018  Â·  28Comments  Â·  Source: remy/nodemon

  • nodemon -v: 1.17.5
  • node -v: 8.11.2
  • Operating system/terminal environment:
    Windows 10 Pro N, Build 17134
  • Command you ran:
    nodemon --verbose ./node_stock/bin/www

Expected behaviour

Start a server and listen to the file changes

Actual behaviour

Keeps restarting without any changes.

Steps to reproduce

Works normally in -L (legacy mode).


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

nodemon --verbose ./node_stock/bin/www

[nodemon] 1.17.5
[nodemon] reading config .\nodemon.json
[nodemon] to restart at any time, enter rs
[nodemon] or send SIGHUP to 12128 to restart
[nodemon] ignoring: .git node_stock/client//* node_stock/node_modules//* npm-debug.log node_stock/node_modules/../node_modules node_stock/.test.js node_stock/fixtures//
[nodemon] watching: D:\Projects\luckstock\node_stock/
/*
[nodemon] watching extensions: js,json
[nodemon] starting node ./node_stock/bin/www
[nodemon] forking
[nodemon] child pid: 6164
[nodemon] watching 763 files
[nodemon] files triggering change check: node_stock\apps\items\itemsStore.js
[nodemon] matched rule: D:\Projects\luckstock\node_stock/*/
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] Node_stock\apps\items\itemsStore.js

[nodemon] files triggering change check: node_stock\apps\orders\index.js
[nodemon] matched rule: D:\Projects\luckstock\node_stock/*/
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] Node_stock\apps\orders\index.js
....

windows

Most helpful comment

I don't know what exactly is going on, has Windows April Update introduced a bug or fixed it and nodemon needs to be patched? As a workaround you can disable access time modifications completely with fsutil behavior set disablelastaccess 1 (open console in an admin mode,) if it doesn't help, try to restart your PC.

All 28 comments

Uninstalling/reinstalling nodemon doesn't help.
Reverting to earlier version (1.8.1 for example) doesn't help.
Guess, Microsoft has released some updates to the OS, breaking fsevents module.

Isn't fsevents module an optional dependency, only installed on OS X to access the FSEvents API? I am not sure if it's relevant here.

In this case, I don't have a clue what could be a reason.
Have tried reverting to older versions, running in legacy mode, uninstalling and reinstalling nodemon, but can't get it running normally as earlier. Keeps restarting even if I simply refresh the browser window.
Restarts 10-20 times before the app starts listening to the port. Development became a nightmare,
What could I do to fix it?

Still digging this issue and therefore can't develop the project.
I recently found that once "access time" of a project file is updated, nodemon restarts.
Modification time of a file is not affected. Therefore, in live reload accessing the file updates "access timestamp" leading to multiple/looped restarts of nodemon.
Please help!

I also have same problem, as a workaround i run node first, then cancel it and then run nodemon and that stops the restart loop for a while, after a while (sort of random) nodemoon loops again.

I checked with my coworkers, the ones that have the lastest Windows 10 update are the ones with this problem.

oh so this is an issue with windows ?
I mean it constantly Restart due to Changes to me

I don't know what exactly is going on, has Windows April Update introduced a bug or fixed it and nodemon needs to be patched? As a workaround you can disable access time modifications completely with fsutil behavior set disablelastaccess 1 (open console in an admin mode,) if it doesn't help, try to restart your PC.

@Dattaya, Thank you very much!
Your solution works. It's not a native solution, but works!

I have the same problem, I use Windows 10 and a week ago it was updated. Well, I'm glad to know the origin, I was already going crazy.

Same problem here. I'm on windows too, probably i also just updated the SO but i'm not sure. anyway seems that just accessing the files trigger a restart!

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

In Windows it continues to affect.

@tojacob even after running fsutil behavior set disablelastaccess 1 on an elevated command prompt?

@AbdelrahmanHafez: After executing the command everything worked normally.

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

fsutil behavior set disablelastaccess 1 also worked for me.

Just adding a dummy comment to stop this issue from being closed!

Since no one has offered anything by way of pull request, I'm going to add this to the FAQ (as far as I can tell it's Windows triggering an IO event that it shouldn't be).

Something you can also try is a completely fresh installation of nodemon (to pick up the latest version of chokidar - which does the actual watching) - though I doubt if that'll fix anything…

The same happened to me on MacOS node 10, npm 6, nodemon 1.10. Upgrading nodemon to 1.18 bringing the latest chokidar fixed the issue. Thanks to @markablov for his patch.

fsutil behavior set disablelastaccess 1 worked for me

Still happening and even fsutil behavior set disablelastaccess 1 doesn't work for me

Still happening here aswell... "fsutil behavior set disablelastaccess 1" doesent work for me neither

Please suggest some on this. Still this is happening for me.

@deveshsinghal22 here you go: upgrade. This issue was filed 9 months ago. Suggest upgrading nodemon. If you're seeing a new issue, please file a new issue.

Still happening and evenfsutil behavior set disablelastaccess 1 doesn't work for me

OS window 8.1
nodemon = 1.19 latest
node = 10.15.1

executing following command as administrator:
fsutil behavior set disablelastaccess 1
worked for me on windows 10.

fsutil behavior set disablelastaccess 1
Worked for me Windows 10

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piton13 picture piton13  Â·  3Comments

olalonde picture olalonde  Â·  3Comments

Bastorx picture Bastorx  Â·  5Comments

medoix picture medoix  Â·  4Comments

binarykitchen picture binarykitchen  Â·  5Comments