Hbuilder glob error [Error: ENFILE: file table overflow, scandir

hbuilder 编译代码的时候经常会出现这个错误。前几天的时候没太在意,一般就是直接暴力重启ide 解决。

10:18:25.178 项目 'dayima_uniapp' 开始编译...
10:18:26.621 请注意运行模式下,因日志输出、sourcemap以及未压缩源码等原因,性能和包体积,均不及发行模式。
10:18:26.730 正在编译中...
10:18:27.388  INFO  Starting development server...
10:18:37.758 glob error [Error: ENFILE: file table overflow, scandir '/Users/obaby/PycharmProjects/dayima_uniapp/uni_modules/mp-html/static/app-plus/mp-html/js/handler.js'] {
10:18:37.767   errno: -23,
10:18:37.767   code: 'ENFILE',
10:18:37.774   syscall: 'scandir',
10:18:37.776   path: '/Users/obaby/PycharmProjects/dayima_uniapp/uni_modules/mp-html/static/app-plus/mp-html/js/handler.js'
10:18:37.786 }
10:18:37.977 ENFILE: file table overflow, scandir '/Users/obaby/PycharmProjects/dayima_uniapp/uni_modules/mp-html/static/app-plus/mp-html/js/handler.js'

但是,今天重启两次 ide 了没有解决问题还是报错,当然页面展现也是报错了。

如果不是系统文件路径,我都怀疑是自己代码写错了。这就 tm 抑郁了啊。要解决也简单,该系统的文件数量限制,命令如下:

echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
sudo ulimit -n 65536 

 参考链接:

https://blog.csdn.net/wkyb608/article/details/80083628

☆版权☆

* 网站名称:obaby@mars
* 网址:https://lang.ma/
* 个性:https://oba.by/
* 本文标题: 《Hbuilder glob error [Error: ENFILE: file table overflow, scandir》
* 本文链接:https://lang.ma/2023/10/13877
* 短链接:https://oba.by/?p=13877
* 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。


You may also like

8 comments

  1.   Level 5
    Firefox 115 Firefox 115 GNU/Linux GNU/Linux cn广东省珠海市 电信

    咦,是MAC上遇到的,我在windows下开发没遇到过这个问题……

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注