【发布时间】:2018-10-03 04:12:27
【问题描述】:
【问题讨论】:
-
打电话给
create-react-app agent_mo并加入...Downloads/my-app...很奇怪。
【问题讨论】:
create-react-app agent_mo并加入...Downloads/my-app...很奇怪。
运行以下命令以避免 ENOSPC:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
对于 Arch Linux,将此行添加到 /etc/sysctl.d/99-sysctl.conf:
fs.inotify.max_user_watches=524288
然后执行:
sysctl --system
这也将在重新启动后持续存在。
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details
【讨论】:
Listen 在 Linux 上默认使用 inotify 来监视目录的更改。您可以监控的文件数量遇到系统限制的情况并不少见。例如,Ubuntu Lucid(64 位)的 inotify 限制设置为 8192。
您可以通过执行以下命令获取当前的 inotify 文件监视限制:
$ cat /proc/sys/fs/inotify/max_user_watches
当此限制不足以监视目录中的所有文件时,必须增加限制才能使 Listen 正常工作。
您可以通过以下方式临时设置新的限制:
$ 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
如果 Listen 一直在抱怨,您可能还需要注意 max_queued_events 和 max_user_instances 的值。
【讨论】: