[英]events.js:183 throw er; // Unhandled 'error' event
Run the below command to avoid ENOSPC: 运行以下命令以避免ENOSPC:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
For Arch Linux add this line to /etc/sysctl.d/99-sysctl.conf
: 对于Arch Linux,将此行添加到/etc/sysctl.d/99-sysctl.conf
:
fs.inotify.max_user_watches=524288
Then execute: 然后执行:
sysctl --system
This will also persist across reboots. 这也将在重新启动后持续存在。
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details
References: Node.js: what is ENOSPC error and how to solve? 参考文献: Node.js:什么是ENOSPC错误以及如何解决?
Listen uses inotify by default on Linux to monitor directories for changes. 默认情况下,Listen在Linux上使用inotify来监视目录以进行更改。 It's not uncommon to encounter a system limit on the number of files you can monitor. 在可监视的文件数量上遇到系统限制并不罕见。 For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192. 例如,Ubuntu Lucid的(64位)inotify限制设置为8192。
You can get your current inotify file watch limit by executing: 您可以通过执行以下命令获取当前的inotify文件监视限制:
$ cat /proc/sys/fs/inotify/max_user_watches
When this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly. 如果此限制不足以监视目录中的所有文件,则必须增加限制以使Listen正常工作。
You can set a new limit temporary with: 您可以使用以下方法设置临时新限制:
$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p
If you like to make your limit permanent, use: 如果您想永久限制,请使用:
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p
You may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining. 如果Listen继续抱怨,您可能还需要注意max_queued_events和max_user_instances的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.