Files are watched even if in the ignore list
See original GitHub issuenodemon -v: 2.0.19node -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.
Issue Analytics
- State:
- Created a year ago
- Comments:16 (8 by maintainers)

Top Related StackOverflow Question
I also note that the “perfect” version is to use
**/cache/**this means that it’ll have a more exact match to the path.🎉 This issue has been resolved in version 2.0.20 🎉
The release is available on:
Your semantic-release bot 📦🚀