In case you’re experiencing problems with using Hexo, here is a list of solutions to some frequently encountered issues. If this page doesn’t help you solve your problem, try doing a search on GitHub or our Google Group.
YAML Parsing Error
|
Wrap the string with quotations if it contains colons.
|
Make sure you are using soft tabs and add a space after colons.
You can see YAML Spec for more info.
EMFILE Error
|
Though Node.js has non-blocking I/O, the maximum number of synchronous I/O is still limited by the system. You may come across an EMFILE error when trying to generate a large number of files. You can try to run the following command to increase the number of allowed synchronous I/O operations.
|
Process Out of Memory
When you encounter this error during generation:
Increase Node.js heap memory size by changing the first line of hexo-cli
(which hexo
to look for the file).
Out of memory while generating a huge blog · Issue #1735 · hexojs/hexo
Git Deployment Problems
|
Make sure you have set up git on your computer properly or try to use HTTPS repository URL instead.
Server Problems
|
You may have started two Hexo servers at the same time or there might be another application using the same port. Try to modify the port
setting or start the Hexo server with the -p
flag.
|
Plugin Installation Problems
|
This error may occur when trying to install a plugin written in C, C++ or another non-JavaScript language. Make sure you have installed the right compiler on your computer.
Error with DTrace (Mac OS X)
|
DTrace install may have issue, use this:
See #1326
Iterate Data Model on Jade or Swig
Hexo uses Warehouse for its data model. It’s not an array so you may have to transform objects into iterables.
|
Data Not Updated
Some data cannot be updated, or the newly generated files are identical to those of the last version. Clean the cache and try again.
|
No command is executed
When you can’t get any command except help
, init
and version
to work and you keep getting content of hexo help
, it could be caused by a missing hexo
in package.json
:
|
Escape Contents
Hexo uses Nunjucks to render posts (Swig was used in older version, which share a similar syntax). Content wrapped with {% raw %}{{ }}{% endraw %}
or {% raw %}{% %}{% endraw %}
will get parsed and may cause problems. You can wrap sensitive content with the raw
tag plugin.
|
ENOSPC Error (Linux)
Sometimes when running the command $ hexo server
it returns an error:
It can be fixed by running $ npm dedupe
or, if that doesn’t help, try the following in the Linux console:
This will increase the limit for the number of files you can watch.
EMPERM Error (Windows Subsystem for Linux)
When running $ hexo server
in a BashOnWindows environment, it returns the following error:
Unfortunately, WSL does not currently support filesystem watchers. Therefore, the live updating feature of hexo’s server is currently unavailable. You can still run the server from a WSL environment by first generating the files and then running it as a static server:
This is a known BashOnWindows issue, and on 15 Aug 2016, the Windows team said they would work on it. You can get progress updates and encourage them to prioritize it on the issue’s UserVoice suggestion page.
Template render error
Sometimes when running the command $ hexo generate
it returns an error:
It means that there are some unrecognizable words in your file.There are two possibilities One is your new page/post, and the other one is _config.yml
.
In _config.yml
, don’t forget add whitespace before a list in hash. There is the wiki page about YAML.
The error one:
The correct one: