Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: ENOSPC: System limit for number of file watchers reached angular

I am getting this error while doing my Angular 10 project.

Error from chokidar (/myProject): Error: ENOSPC: System limit for number of file watchers reached, watch '/myProject/tsconfig.spec.json'

Is there a method to resolve this error?

like image 919
MikhilMC Avatar asked Dec 15 '20 04:12

MikhilMC


People also ask

How do I increase file watchers?

Increase the limit The limit can be increased to its maximum (524288) by editing /etc/sysctl. conf and appending this line to the file. The value appended will be printed to the console if the append worked. This should be the only time you have to do this until you have to set up a new system again.


Video Answer


2 Answers

You're running into a kernel limit with your inotify watchers. You can run this to fix it for the current boot,

sudo sysctl -w fs.inotify.max_user_watches=524288

You can run this to fix it for future boots,

echo "fs.inotify.max_user_watches=524288" \ 
  | sudo tee -a /etc/sysctl.conf
like image 136
user3294794 Avatar answered Oct 22 '22 11:10

user3294794


I found this post and helped me to solve that problem. All you have to do is change the max_user_watches

Error ENOSPC System limit for number of file watchers reached

like image 12
Alan Mejia Avatar answered Oct 22 '22 09:10

Alan Mejia