I have a simple Angular app, that is a collection of small example apps.
(The code can be found on GitHub, and the homepage is here.)
I work on it locally.
Suddenly the following error message is all over my console, when I do ng serve
:
Watchpack Error (watcher): Error: ENOSPC:
System limit for number of file watchers reached,
watch ‘/home/tilman/Code/angular_examples/node_modules/blah/blah’
But the app still works. There seems to be no problem, except my flooded console.
Some details:
Ubuntu 20.04
PyCharm 2024.1.3 (Professional Edition)
Angular CLI: 13.3.4
Node: 17.9.0 (Unsupported, according to ng v
)
Package Manager: npm 8.5.5
/proc/sys/fs/inotify/max_user_watches
: 65536
Similar questions have been asked about React in 2019 and about Angular in 2021.
The answers sound like: Pressing some buttons worked for me.
But I would like to know what is going on here.
I was not aware, that file watchers are a thing.
Do I need them? Where are they? Why are there so many? How to clean them up?
One of the proposed solutions is deleting and reinstalling node_modules
.
That is not a good way to solve problems. (What if something is gone, when I try to reinstall it?)
Here is a screenshot, showing Compiled successfully among the error messages: