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

Background:

System: Ubuntu18

Problem scenario: When writing a case using react scaffolding, use instructions   npm start Unsuccessful, occurred Error: enospc: system limit for number of file watchers error.

Solution:

Error: enospc: system limit for number of file watchers error. The system limit of the file monitor has reached the default upper limit and needs to be increased.

Instructions can be used  $cat /proc/sys/fs/inotify/max_user_Watch to see

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: