question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Files are watched even if in the ignore list

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
remycommented, Aug 16, 2022

I also note that the “perfect” version is to use **/cache/** this means that it’ll have a more exact match to the path.

0reactions
github-actions[bot]commented, Sep 16, 2022

🎉 This issue has been resolved in version 2.0.20 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git command to show which specific files are ignored by ...
gitignore files, as it lists every single cotton-pickin' file that is ignored. You would normally pipe the results through grep to see if...
Read more >
Solved: Does Splunk re-index a file that was ignored due t...
Solved: Hi, I have a folder being monitored and ignoreOlderThan is set as 4 days. Since, the environment is not used frequently, the...
Read more >
.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Git ignore patterns are used to exclude certain files in your working directory from your Git history. They can be local, global, or...
Read more >
ignoring doesn't remove a file - Git Ready
gitignore file. The answer to this is quite simple! When you tell Git to ignore files, it's going to only stop watching changes...
Read more >
Log input | Filebeat Reference [8.5] - Elastic
The option inode_marker can be used if the inodes stay the same even if the device id is changed. You should choose this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found