Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Too many open files Visual Studio Code

It's been a while since I entered Visual Studio Code to program...

When I am going to use Angular, I realize that I have to update it, I update it and when I am going to start programming it tells me that I have many files in the Git area, I see the number 10,000, then I try to hit the check but I get says:

"Error: EMFILE: too many open files, stat '/run/user/1000/doc/bb7f399/NewProject/src'"

I tried to check the visual studio but it didn't work...

Then I restarted the computer to see if it worked but nothing.

like image 564
Daniel Alejandro Marin Zapata Avatar asked Oct 14 '25 09:10

Daniel Alejandro Marin Zapata


1 Answers

The error message you're seeing suggests that there are too many files open on your system, which can happen when you have a lot of files in your project or your system is running low on resources.

To fix this issue, there are a few things you can try:

  1. Make sure you excluded node_modules folder inside your .gitignore.
  2. Check if you have a file watcher on node_modules folder.
  3. Close any unnecessary applications or processes to free up system resources for Visual Studio Code to use.
  4. Increase the maximum number of open files allowed on your system by modifying the ulimit settings in your terminal.
  5. Use a file system watcher like Chokidar that's optimized for large projects with many files. You can install it by running npm install chokidar and then updating your angular.json file to use Chokidar instead of the default file system watcher.

Hope this helps! Let me know if you have any more questions.

like image 158
Don Avatar answered Oct 17 '25 01:10

Don



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!