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

Project environment

Vue project

Cause of problem

The number of file monitoring is too large and the system limits it

Modify {etc/sysctl.d

 fs.inotify.max_user_watches = 524288

Apply changes

sudo sysctl -p --system

Docker inherits some setting files on the host. In order to prevent global impact, the above files will be set to read only in docker. Therefore, you need to change the above configuration on the host. After the host changes, docker automatically inherits.

Read More: