解决:Error: ENOSPC: System limit for number of file watchers reached
原因:文件监视程序的系统产生了限制,达到了默认的上限,需要增加限额。
查看当前限额数量:cat /proc/sys/fs/inotify/max_user_watch
临时增加限额:
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p永久增加限额:
echo fs.inotify.max_user_watches = 524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p如果是Docker容器内,则无法直接这么修改,会说reay-only。
因为Docker container会继承宿主机的该配置,只要在宿主机按照上面的方法改即可。