错误“达到 inotify 监视的用户限制”。 ExtReact 构建

2024-05-13

我安装了 ExtReact,并附有示例。当我跑步时

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"

如何修复这个错误?


Why?

同步文件的程序(例如 dropbox、git 等)使用 inotify 来通知文件系统的更改。极限可以通过以下方式查看 -

cat /proc/sys/fs/inotify/max_user_watches

对我来说,它表明100000。当此限制不足以监视目录内的所有文件时,它会抛出此错误。


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

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

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

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

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

然后将其粘贴到终端中并按 Enter 运行它。


技术细节:

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 的值。

Source: https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

错误“达到 inotify 监视的用户限制”。 ExtReact 构建 的相关文章

随机推荐