Open janderland opened 8 years ago
Same problem, anyone can fix it?
https://hexo.io/docs/troubleshooting.html#EMFILE-Error
Thanks for your feed back. Hexo won't handle system I/O. People also raising similar issue on windows bash https://github.com/Microsoft/BashOnWindows/issues/1126 . They provide some solution, hope that would help.
On my Window 7 system, the "hexo server" command will usually crash with the EMFILE error. I say usually because if I run "hexo clean && hexo server" enough times then it eventually works. Below is my cmd shell dump...
I tested the exact same hexo site on my Macbook and an EMFILE error is never thrown.
Notice that the EMFILE error actually occur's during a require() call by the readdirp module. One possible solution could be to 'gracefulify' the fs module during the hexo-fs module's initialization...
var fs = require('graceful-fs'); var nodeFs = require('fs'); fs.gracefulify(nodeFs);
... though I haven't tested the effects this would have on performance.