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
Files are watched even if in the ignore list #2057
Comments
To know what to watch and what to ignore (for restart) it still needs to
enumerate all the files in the tree.
Don't run nodemon from a root system folder, or rather run it in the
project scope.
…On Mon, 15 Aug 2022, 18:31 cberescu, ***@***.***> wrote:
- nodemon -v: 2.0.19
- node -v: v16.16.0
- Operating system/terminal environment: docker
- Using Docker? What image: *Custom*
FROM node:16.16.0
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
RUN npm install -g nodemon
RUN mkdir -p /app
WORKDIR /app
CMD ["nodemon", "--exec", "npm start || touch _keepalive.js"]
- Command you ran: npm install && node app.js
Expected behaviour
should ignore all files that are set in the nodemon config
{
"verbose": true,
"ignore": ["package-lock.json", "node_modules/*","logs/*","cache/*"],
"delay": 3000
}
Actual behaviour
It still parses the directories. The cache directory has around 7mil
files, if i remove the directory outside the node app everything works as
expected, as soon as i move it back i get : [nodemon] Internal watch
failed: ENOSPC: System limit for number of file watchers reached, watch
'/app/cache/288_162/6963394_288_162.jpg'
What i think happens , all files are watched, even in the ignore
directory, and if they are changed nodemon does not restart the app
but it knows that the file was changed.
I think it should not watch files that are in the ignore list.
Steps to reproduce
I guess create a directory with 7mil files ?
------------------------------
[nodemon] 2.0.19
[nodemon] reading config ./nodemon.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 1 to restart
[nodemon] ignoring: package-lock.json node_modules/**/* logs/**/* cache/**/*
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `npm start || touch _keepalive.js`
[nodemon] spawning
[nodemon] child pid: 26
[nodemon] watching 15 files
If applicable, please append the --dump flag on your command and include
the output here *ensuring to remove any sensitive/personal details or
tokens*.
—
Reply to this email directly, view it on GitHub
<#2057>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAADLBEXA7N5Y3AWGJJQOXLVZJ4WTANCNFSM56S5DRGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi @remy and thanks for the answer . If i put in the ignore list this : cache/**/* , in what situation does it need to watch the files inside it ? I am running it in the project scope. It is a images server in witch i choose to keep a folder with cached images inside the project scope. |
"watch" is misleading, nodemon needs to look at files initially to match what to watch and ignore. If you change from the negative to additive, you can say Failing that, run with debug env to find out and share what's happening: |
So, i added the debug env and i get this :
witch i think it should not even enter in that folder as everything in it needs to be ignored. Also it takes .jpg/.png/.etc extension, witch aren't in the default list. |
Also, the beginning looks like this ;
After this comes the long list from cache. If i am looking in the debug logs after i remove the cache directory i get this :
So here i got some unclear things :
|
okay, quick test tells me the config isn't being loaded right. if you run |
Sod, the debug should be this too: |
Change the nodemon.json to this:
Note there's no "glob" at the end. |
ok, will do now , this is the extra log :
|
yeap, removing the "glob" fixed it |
Just confirming, but this is not really completed right? It is a bug. Or the documentation is missleading? |
Docs need to be clearer (probably in the faq)
…On Mon, 15 Aug 2022, 23:48 cberescu, ***@***.***> wrote:
Just confirming, but this is not really completed right? It is a bug. Or
the documentation is missleading?
—
Reply to this email directly, view it on GitHub
<#2057 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAADLBB4LZR4BYPLAV375TDVZLCMJANCNFSM56S5DRGA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I also note that the "perfect" version is to use |
I've added this to the readme, and changed the examples to use the explicit |
Thanks for the quick reply and all the help. |
🎉 This issue has been resolved in version 2.0.20 🎉 The release is available on: Your semantic-release bot 📦🚀 |
nodemon -v
: 2.0.19node -v
: v16.16.0npm install && node app.js
Expected behaviour
should ignore all files that are set in the nodemon config
Actual behaviour
It still parses the directories. The cache directory has around 7mil files, if i remove the directory outside the node app everything works as expected, as soon as i move it back i get :
[nodemon] Internal watch failed: ENOSPC: System limit for number of file watchers reached, watch '/app/cache/288_162/6963394_288_162.jpg'
What i think happens , all files are watched, even in the ignore directory, and if they are changed nodemon does not restart the app
but it knows that the file was changed.
I think it should not watch files that are in the ignore list.
Steps to reproduce
I guess create a directory with 7mil files ?
If applicable, please append the
--dump
flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.The text was updated successfully, but these errors were encountered: