Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Error: EMFILE: too many open files (ulimit does not work on Windows 10) #2090
In the Hexo troubleshooting guide they say to try
...but this does not work on Windows.
This happens because hexo is watching ALL files in sub folders. If you're using grunt, gulp in your theme there are thousands of files and hexo doesn't ignore then.
The only workaround is currently to keep your node_modules outside the hexo root and create a gulp task which copy the files to theme folder.
Agree with you. This was the first thing I did when I saw this error.
Anyway. I couldn't make my theme work without node_modules because it required some files.
Probably there's an issue with the theme itself (tranquilpeak) but shouldn't hexo avoid to check folders like node_modules, bower_components, etc? maybe making this configurable.
I seem to find out how to exclude some directories from the targets of watch().
Could you please try following patch?
Of course, I will make targets configurable when I make a pull request.
Thank you in advance for your cooperation.
I have hexo 3.2.0
I applied the .2 patch, but unfortunately, it still not works.
Could you taste my new patch?
The patch which I wrote in above comment is not enough.
I make new patch to turn-off readdir()/watch() for specified directories.
And also you can configure which directores are ignored.
My repository is:
The branch is:
Please checkout the
p.s. When you execute
In addition, if you are not familiar with
These links point my commit
And also you can recover these files:
Thanks for your request!
Before I make a pull request, I should make test cases for the patch.
I'm sorry for the delay, but I'll make a pull request.