Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodemon restarts multiple times #1354

Closed
LuckStock opened this issue May 23, 2018 · 30 comments
Closed

Nodemon restarts multiple times #1354

LuckStock opened this issue May 23, 2018 · 30 comments
Labels

Comments

@LuckStock
Copy link

  • 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
....

@LuckStock
Copy link
Author

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.

@lpgera
Copy link
Contributor

lpgera commented May 24, 2018

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.

@LuckStock
Copy link
Author

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?

@LuckStock
Copy link
Author

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!

@masterpandabear
Copy link

masterpandabear commented May 28, 2018

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.

@ayami123
Copy link

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

@Dattaya
Copy link

Dattaya commented May 29, 2018

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.

@LuckStock
Copy link
Author

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

@jacsamg
Copy link

jacsamg commented May 31, 2018

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.

@balciseri
Copy link

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!

@AbdelrahmanHafez
Copy link

#1354 (comment) solves it!

@stale
Copy link

stale bot commented Jun 20, 2018

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

@stale stale bot added the stale no activity for 2 weeks label Jun 20, 2018
@jacsamg
Copy link

jacsamg commented Jun 20, 2018

In Windows it continues to affect.

@stale stale bot removed the stale no activity for 2 weeks label Jun 20, 2018
@AbdelrahmanHafez
Copy link

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

@jacsamg
Copy link

jacsamg commented Jun 21, 2018

@AbdelrahmanHafez: After executing the command everything worked normally.

@stale
Copy link

stale bot commented Jul 6, 2018

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

@stale stale bot added the stale no activity for 2 weeks label Jul 6, 2018
@TynesideGroup
Copy link

fsutil behavior set disablelastaccess 1 also worked for me.

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

@stale stale bot removed the stale no activity for 2 weeks label Jul 6, 2018
@remy
Copy link
Owner

remy commented Jul 10, 2018

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…

@remy remy closed this as completed Jul 10, 2018
remy added a commit that referenced this issue Jul 10, 2018
Ref #1354
Ref #1346

[skip ci]
@markablov
Copy link

Small fix for chokidar - paulmillr/chokidar#762

@kamenov
Copy link

kamenov commented Sep 26, 2018

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.

@apoorvagarwal41
Copy link

fsutil behavior set disablelastaccess 1 worked for me

@HJain13
Copy link

HJain13 commented Dec 24, 2018

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

@GRGL-RC
Copy link

GRGL-RC commented Jan 11, 2019

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

@deveshsinghal22
Copy link

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

@remy
Copy link
Owner

remy commented Mar 26, 2019

@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.

@bilalbutt044
Copy link

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

OS window 8.1
nodemon = 1.19 latest
node = 10.15.1

@jatinderkumargupta
Copy link

jatinderkumargupta commented Jun 12, 2019

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

@teja123r
Copy link

teja123r commented Jan 2, 2020

fsutil behavior set disablelastaccess 1
Worked for me Windows 10

@tEgRaT
Copy link

tEgRaT commented Jan 26, 2021

executing fsutil behavior set disablelastaccess 1 command as administrator and restart computer, then...
it doesn't help.

Windows 7 Pro 64X

@oshihirii
Copy link

for others searching, per remy's comment updating seems to resolve this issue for me. windows 10. node v16.13.0. nodemon 2.0.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests