Error: EMFILE: too many open files, watch 报错的解决方法

简介: Error: EMFILE: too many open files, watch 报错的解决方法

运行一个nodejs项目,发现一直报错Error: EMFILE: too many open files, watch

ulimit

tioncico@acbc32866c55 ~ % ulimit -a
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         0
-v: address space (kbytes)          unlimited
-l: locked-in-memory size (kbytes)  unlimited
-u: processes                       2784
-n: file descriptors                524288
tioncico@acbc32866c55 ~ % sudo ulimit -n 524288
Password:
tioncico@acbc32866c55 ~ %

修改完ulimit -n发现还是会报错

修改launchctl

tioncico@acbc32866c55 ~ % launchctl limit 
  cpu         unlimited      unlimited      
  filesize    unlimited      unlimited      
  data        unlimited      unlimited      
  stack       8388608        67104768       
  core        0              unlimited      
  rss         unlimited      unlimited      
  memlock     unlimited      unlimited      
  maxproc     2784           4176           
  maxfiles    524288         524288         
tioncico@acbc32866c55 ~ % sudo launchctl limit maxfiles 524288 524288 
tioncico@acbc32866c55 ~ % launchctl limit                             
  cpu         unlimited      unlimited      
  filesize    unlimited      unlimited      
  data        unlimited      unlimited      
  stack       8388608        67104768       
  core        0              unlimited      
  rss         unlimited      unlimited      
  memlock     unlimited      unlimited      
  maxproc     2784           4176           
  maxfiles    524288         524288         
tioncico@acbc32866c55 ~ %

竟然还是不行

最后重新安装watchman 解决

brew reinstall watchman
目录
相关文章
微信分享报错 wxlog:Error:fail to load Keychain status:-25300 解决办法
微信分享报错 wxlog:Error:fail to load Keychain status:-25300 解决办法
2424 0
|
4月前
|
C#
【Azure Function】Function App启动时出现 Failed to open local port 4001 错误,这是什么情况呢?
【Azure Function】Function App启动时出现 Failed to open local port 4001 错误,这是什么情况呢?
|
缓存 Windows
【cmd报错:Error :could not open】
【cmd报错:Error :could not open】
244 0
Error:npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\XX\package.json‘son‘
Error:npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\XX\package.json‘son‘
|
JavaScript
Error: EMFILE: too many open files, watch 报错的解决方法
Error: EMFILE: too many open files, watch 报错的解决方法
703 1
|
Linux 开发工具
Too many open files 解决办法
还在等什么,快来一起讨论关注吧,公众号【八点半技术站】,欢迎加入社群
Error:Failed to open zip file. Re-download dependencies and sync project
Error:Failed to open zip file. Re-download dependencies and sync project
148 0
|
机器学习/深度学习 Web App开发 移动开发
pip安装时 fatal error C1083 无法打开包括文件 “io.h” No such file or directory
pip安装时 fatal error C1083 无法打开包括文件 “io.h” No such file or directory
577 2
|
Unix Shell Linux