错误“已达到 inotify 手表的用户限制".ExtReact 构建 [英] Error "User limit of inotify watches reached". ExtReact build

查看:17
本文介绍了错误“已达到 inotify 手表的用户限制".ExtReact 构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 ExtReact,并附有示例.当我跑

I installed ExtReact, with examples. When I run

npm start

我收到一个错误:

ERROR in [@extjs/reactor-webpack-plugin]: Error:
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: User limit of inotify watches 
reached
[ERR]
[ERR] Total time: 13 seconds

[ERR] /home/user/project/build/ext-react/build.xml:101: 
com.sencha.exceptions.BasicException: User limit of inotify watches reached
[ERR] A log is available in the file "/home/user/project/build/ext-
react/sencha-error-20171027.log"

如何修复这个错误?

推荐答案

为什么?

同步文件的程序(例如 dropbox、git 等)使用 inotify 来通知文件系统的更改.限制可以通过 -

Programs that sync files such as dropbox, git etc use inotify to notice changes to the file system. The limit can be see by -

cat /proc/sys/fs/inotify/max_user_watches

对我来说,它显示 100000.当此限制不足以监视目录中的所有文件时,它会引发此错误.

For me, it shows 100000. When this limit is not enough to monitor all files inside a directory it throws this error.

增加inotify观察者的数量(短版):

如果您正在运行 Debian、RedHat 或其他类似的 Linux 发行版,请在终端中运行以下命令:

If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

如果您正在运行 ArchLinux,请改为运行以下命令(请参阅此处了解原因):

If you are running ArchLinux, run the following command instead (see here for why):

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

然后将其粘贴到您的终端中,然后按 Enter 以运行它.

Then paste it in your terminal and press on enter to run it.

技术细节:

Listen 在 Linux 上默认使用 inotify 来监视目录的变化.遇到系统限制您可以监视的文件数量的情况并不少见.例如,Ubuntu Lucid(64 位)的 inotify 限制设置为 8192.

Listen uses inotify by default on Linux to monitor directories for changes. 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.

您可以通过执行以下命令获取当前的 inotify 文件监视限制:

You can get your current inotify file watch limit by executing:

$ 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.

您可以临时设置一个新的限制:

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

如果 Listen 一直在抱怨,您可能还需要注意 max_queued_events 和 max_user_instances 的值.

You may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining.

来源:https://github.com/守卫/听/维基/增加inotify-watchers的数量

这篇关于错误“已达到 inotify 手表的用户限制".ExtReact 构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆