[Others] 前端项目启动报错: Error: ENOSPC
Tofloor
poster avatar
琉璃
deepin
2021-10-05 06:41
Author
Error from chokidar (......): Error: ENOSPC: System limit for number of file watchers reached, watch '....../index.tsx'

React, TypeScript 项目, 使用npm / yarn 安装依赖都没问题, 启动开发服务器时候报错, 普通项目勉强还能运行, 如果是ant design 的项目,错误太多直接就炸了, 没法运行

不是很懂发生了啥, 还有就是WebStrom 打开项目时会提示:

Reply Favorite View the author
All Replies
琉璃
deepin
2021-10-05 06:45
#1

jetbrains 建议:

图片是机翻, 原文链接: https://youtrack.jetbrains.com/articles/IDEA-A-2/Inotify-Watches-Limit

有没有必要更改此设置?

Reply View the author
186******86
deepin
2023-06-03 19:07
#2

To prevent this situation it is recommended to increase the watches limit (to, say, 512K):

  1. 将以下行添加到文件 /etc/sysctl.conf 或 在文件夹 /etc/sysctl.d/ 下新建一个文件 *.conf (例: idea.conf)
    fs.inotify.max_user_watches = 524288
  2. 运行下面命令应用此改变
    sudo sysctl -p --system

然后重启IDE

Reply View the author