4

I'm trying to make a project in angular but when I try to compile it shows me these errors over and over till my IDE closes.

Watchpack Error (watcher): Error: ENOSPC: System limit for number of file watchers 
reached, watch '/home/pedro/Universidad/Vacas-Dic2021/Archivos/LAB/MIA_Proyecto2_201709146_201900612/SoccerStatistics/node_modules/typescript'
Watchpack Error (watcher): Error: ENOSPC: System limit for number of file watchers 
reached, watch '/home/pedro/Universidad/Vacas-Dic2021/Archivos/LAB/MIA_Proyecto2_201709146_201900612/SoccerStatistics/node_modules/typesript/lib' 

I'm using angular 12 and node 14.17.6

Pedro Castro
  • 53
  • 1
  • 6

4 Answers4

5

If you can not increase the size of the watch (fs.inotify.max_user_watches), you can still compile angular using this command :

ng serve --watch --live-reload --poll 2000

Worked for me, and I am using virtual-studio-code as IDE

Pyx
  • 151
  • 1
  • 5
2

Remove node_modules and reinstall packages

(Not the best solution because this bug comes back after restarting the computer)

rm -rf node_modules
yarn install

That does the trick for me :)

Nicolas
  • 2,684
  • 1
  • 16
  • 22
1

You can check it out here to increase the size of the watch.

Jerethom
  • 66
  • 2
1

You can run this command to resolve the problem.

sudo sysctl -w fs.inotify.max_user_watches=524288