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
ENOSPC: System limit for number of file watchers reached #2072
Comments
Hey thanks for the report :) Is there something in your |
No, there is no .yarn/cache folder. Thank you for looking into this! |
:) Does it say which files are being watched? Is it really node_modules? |
I am fairly confident. I opened the file /proc/1641254/fdinfo/31 where 161254 is the PID for the node nx-console process launched inside the dev container. This file has over 20,000 inotify handles listed. I picked some lines at random from that file to see an output like this:
Then, using a simple script, I traced back the inode for those files, and each of them was a file inside node_modules:
Hope this helps. |
Hey I just released some changes to file watching in Nx Console. Can you check and see whether this issue persists on the latest version? |
I have the same problem with the latest version of NX Console |
@ahmedyouseeff can you paste your |
I tried to upgrade to version 19.0.0 and did not consume much watcher for my angular + nodejs projects. "The following packages should match the installed version of nx
I'm remove the old dependency by "rm -rf node_module/@nrwl/devkit" |
@ahmedyouseeff @jamesikanos can you reproduce this issue on the latest version of Nx Console (and if you can, Nx) anymore? |
ENOSPC: System limit for number of file watchers reached
caused by NX opening far too many INOTIFY watchers.NX has over 20,000 registered watchers. Suspect node_modules folder is being watched.
Current Behavior
When the NRWL extension is activated in my NX project (containing several Angular and NodeJS Express projects) I'm seeing that there are several thousand inotify watchers. This regularly causes my Angular Serve commands to fail because it is unable to register enough watchers for it's own purposes.
For example: nrwl.angular-console-18.18.0/nxls/main.js uses 21842 Inotify Watchers whereas nx serve uses less than 1000.
I suspect that NX is watching the node_modules directory. I have added "node_modules/" to an .nxignore file in the root of my project but this doesn't seem to have an impact.
Disabling the NX Extension in VSCode fixes the issue (because none of the watchers are being registered).
Expected Behavior
I do not expect NX VS Code extension to be registering so many INotify watchers causing my other activies to fail.
Steps to Reproduce
Failure Logs / Images / Videos
When the error occurs, nx serve (or nx build --watch) on the angular projects give many thousand error lines saying:
ENOSPC: System limit for number of file watchers reached
Environment
Node : 20.11.1
OS : linux-x64
yarn : 1.22.19
nx (global) : 18.1.3
nx : 18.1.2
@nx/js : 18.1.2
@nx/jest : 18.1.2
@nx/linter : 18.1.2
@nx/eslint : 18.1.2
@nx/workspace : 18.1.2
@nx/angular : 18.1.3
@nx/cypress : 18.1.2
@nx/devkit : 18.1.2
@nx/esbuild : 18.1.2
@nx/eslint-plugin : 18.1.2
@nx/express : 18.1.2
@nx/node : 18.1.2
@nx/storybook : 18.1.2
@nrwl/tao : 18.1.2
@nx/web : 18.1.2
@nx/webpack : 18.1.2
typescript : 5.3.3
Community plugins:
@storybook/angular : 7.6.10
The following packages should match the installed version of nx
To fix this, run
nx migrate nx@18.1.3
Note: Follow up, I ran the migrate to 18.1.3 of nx/angular and still getting the same issue
The text was updated successfully, but these errors were encountered: