[Solved] Linux Error: ENOSPC: System limit for number of file watchers

Problem:
System: Ubuntu 18
problem scenario: when using react scaffold to write a case, the command NPM start is unsuccessful, and an error: enospc: system limit for number of file watchers occurs.

Solution:
error: enospc: system limit for number of file watchers error is that the system of the file monitor has a limit and reaches the default upper limit, so the limit needs to be increased
you can use the instruction $cat/proc/sys/FS/inotify/max_user_watch to see

root@:~$ cat /proc/sys/fs/inotify/max_user_watch
es
524288

New instructions can be set for temporary limit increase:

$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p

Permanent increase limit

$ echo fs.inotify.max_user_watches = 524288 | sudo tee -a /etc/sysctl.conf 
$ sudo sysctl -p

Read More: