hexo: Error: EMFILE: too many open files (ulimit does not work on Windows 10)
In the Hexo troubleshooting guide they say to try
$ ulimit -n 10000
…but this does not work on Windows.
Environment Info
Node version
v5.6.0
My site _config.yml
# Hexo Configuration
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: Cool New Site
subtitle:
description:
author: 8ctopotamus
language:
timezone:
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace:
# Category & Tag
default_category: uncategorized
category_map:
tag_map:
# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: trio-theme
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type:
My theme _config.yml
# Hexo Configuration
# Header
menu:
VISION: /vision
DESIGN: /design
EXECUTION: /execution
REALIZATION: /realization
rss: /atom.xml
# Content
excerpt_link: Read More
# Sidebar
sidebar: right
widgets:
- category
- tag
- tagcloud
- archive
- recent_posts
# display widgets at the bottom of index pages (pagination == 2)
index_widgets:
- category
- tagcloud
- archive
# widget behavior
archive_type: 'monthly'
show_count: false
# Miscellaneous
google_analytics:
favicon: /favicon.png
twitter:
google_plus:
fb_admins:
fb_app_id:
Plugin version(npm ls --depth 0)
hexo-vanilla-site@0.0.0 ~/hexo-vanilla-site
├── hexo@3.1.1
├── hexo-generator-archive@0.1.4
├── hexo-generator-category@0.1.3
├── hexo-generator-index@0.2.0
├── hexo-generator-tag@0.2.0
├── hexo-renderer-ejs@0.1.1
├── hexo-renderer-marked@0.2.10
├── hexo-renderer-stylus@0.3.1
└── hexo-server@0.1.3
For BUG
- I am getting the this error almost every time I run “hexo serve”. I am on WIndows 10 if that makes a difference.
fs.js:584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EMFILE: too many open files, open 'C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\readdirp\stream-api.js'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at Object.Module._extensions..js (module.js:421:20)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at readdir (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\readdirp\readdirp.js:55:25)
at FSWatcher.<anonymous> (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:355:5)
at FSWatcher.NodeFsHandler._handleDir (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:406:18)
at FSWatcher.<anonymous> (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:82:15)
- log with hexo <command> --debug This is what happens when I do “hexo serve --debug”
λ hexo serve --debug
17:26:02.458 DEBUG Hexo version: 3.2.2
17:26:02.464 DEBUG Working directory: ~\Documents\GitHub\trio-hexo\
17:26:02.587 DEBUG Config loaded: ~\Documents\GitHub\trio-hexo\_config.yml
17:26:02.605 DEBUG Plugin loaded: hexo-generator-category
17:26:02.609 DEBUG Plugin loaded: hexo-generator-index
17:26:02.614 DEBUG Plugin loaded: hexo-generator-archive
17:26:02.620 DEBUG Plugin loaded: hexo-renderer-ejs
17:26:02.625 DEBUG Plugin loaded: hexo-renderer-stylus
17:26:02.627 DEBUG Plugin loaded: hexo-generator-tag
17:26:02.689 DEBUG Plugin loaded: hexo-server
17:26:02.696 DEBUG Plugin loaded: hexo-renderer-marked
17:26:02.710 DEBUG Loading database.
17:26:02.937 INFO Start processing
17:26:03.721 DEBUG Processed: Design/index.md
17:26:03.722 DEBUG Processed: Execution/index.md
17:26:03.722 DEBUG Processed: Realization/index.md
17:26:03.723 DEBUG Processed: _posts/hello-world.md
17:26:03.723 DEBUG Processed: _posts/second-post.md
17:26:03.724 DEBUG Processed: vision/index.md
fs.js:584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EMFILE: too many open files, open 'C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\readdirp\stream-api.js'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at Object.Module._extensions..js (module.js:421:20)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at readdir (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\readdirp\readdirp.js:55:25)
at FSWatcher.<anonymous> (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:355:5)
at FSWatcher.NodeFsHandler._handleDir (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:406:18)
at FSWatcher.<anonymous> (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (C:\Users\joshn\Documents\GitHub\trio-hexo\node_modules\chokidar\lib\nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:82:15)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 21 (7 by maintainers)
Thanks for your request!
Before I make a pull request, I should make test cases for the patch. But I found that existing test script for
watch()function was not enough. So I’m trying to improve it. https://github.com/hexojs/hexo/blob/master/test/scripts/hexo/hexo.jsI’m sorry for the delay, but I’ll make a pull request. 😉
Could you taste my new patch?
The patch which I wrote in above comment is not enough. It makes Hexo turning-off only watch() for
node_modules. Hexo continuously calls readdir() for all subdirectories innode_modules.I make new patch to turn-off readdir()/watch() for specified directories. Under the patch, Hexo will ignore
node_modulesdirectory and.gitdirectory and all their subdirectories. Hexo will NEVER call either readdir() nor watch() for these directories.And also you can configure which directores are ignored. You can write
ignored_path:setting in_config.yml(such as afterskip_render:setting) as follows:At this time, you can not use glob expressions, but you can use regular expressions instead. I’m just getting ahead in myself. I will reverse them (suit to
skip_render:setting).My repository is: https://github.com/seaoak/hexo.git
The branch is:
feature/allow-turning-off-reading-and-watching-for-specified-directoriesPlease checkout the
HEADof above branch.p.s. When you execute
hexo, you will see many debugging messages. You can filter them bygrep -v 'seaoak '. I’m sorry.