Daizc
count.articles52
count.tags25
count.categories3
文件观察者数量超过系统限制

文件观察者数量超过系统限制

症状1

在系统文件管理器中新建文件时不会自动刷新。

症状2

启动Angular项目报了如下错误:

1
2
3
4
Watchpack Error (watcher): Error: ENOSPC: System limit for number of file watchers reached, watch '/home/daizc/IdeaProjects/beam/beam-frontend/src/main/angular/node_modules/@webcomponents/webcomponentsjs'
Watchpack Error (watcher): Error: ENOSPC: System limit for number of file watchers reached, watch '/home/daizc/IdeaProjects/beam/beam-frontend/src/main/angular/node_modules/@webcomponents'
Watchpack Error (watcher): Error: ENOSPC: System limit for number of file watchers reached, watch '/home/daizc/IdeaProjects/beam/beam-frontend/src/main/angular/node_modules/@types/trusted-types'
Watchpack Error (watcher): Error: ENOSPC: System limit for number of file watchers reached, watch '/home/daizc/IdeaProjects/beam/beam-frontend/src/main/angular/node_modules/@types'

解决方案:A

React Native Error: ENOSPC: System limit for number of file watchers reached

经验证,重启后会失效

1
2
sudo sysctl fs.inotify.max_user_watches=524288  # 我自己设置的是131072
sudo sysctl -p

解决方案:B

Inotify 监视限制 (Linux)

  1. 将以下行添加到/etc/sysctl.conf文件或目录下的新*.conf文件(例如idea.conf)/etc/sysctl.d/:
    fs.inotify.max_user_watches = 524288
  2. 然后运行此命令以应用更改:
    sudo sysctl -p --system

系统环境:

  • OS: Deepin 20.6 apricot
  • Kernel: x86_64 Linux 5.10.101-amd64-desktop

copyright.author:Daizc
copyright.permalink:https://note.bequick.run/deepin%E4%B8%8B%E7%B3%BB%E7%BB%9F%E7%9B%91%E6%8E%A7%E6%96%87%E4%BB%B6%E6%95%B0%E9%87%8F%E8%B6%85%E8%BF%87%E9%99%90%E5%88%B6/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可