Have you ever tried running npm start, ng serve, or npm run dev on Ubuntu only to be met with a massive "System limit for number of file watchers reached" error? π±
Despite the ENOSPC code, it doesn't mean your SSD is full! π Whatβs actually happening is that your project (Angular, React, or Vite) has grown so large that it exceeded the number of files the Linux Kernel is allowed to "watch" in real-time.
Here is how to fix it forever in 3 simple steps:
1οΈβ£ Check your current limit:
Run this in your terminal to see how many files you can watch right now:
cat /proc/sys/fs/inotify/max_user_watches
(If it says 8192, thatβs way too low for modern development!)
2οΈβ£ Boost it immediately (Temporary fix):
Give your system "more room to breathe" right away:
sudo sysctl fs.inotify.max_user_watches=524288
3οΈβ£ Make it permanent (The Pro move):
To ensure the fix sticks after a reboot:
Open the config file: sudo nano /etc/sysctl.conf
Add this line at the very end: fs.inotify.max_user_watches=524288
Save and apply: sudo sysctl -p
And that's it! Your dev environment can now handle thousands of files without breaking a sweat. ππ»
You know, enjoy learning!!
Top comments (0)