[SOLVED] hexo-include-markdown

found solution, but sharing for others.

I’m trying to include the module hexo-include-markdown on a fresh hexo blog, but it keeps throwing the error when deploying:

8:18:28 PM: Executing user command: hexo generate
8:18:31 PM: **FATAL [hexo-include-markdown] Could not open db.json .**
8:18:31 PM: Error: [hexo-include-markdown] Could not open db.json .
8:18:31 PM:     at ReadFileContext.fs.readFile [as callback] (/opt/build/repo/node_modules/hexo-include-markdown/lib/orverwriteCache.js:22:15)
8:18:31 PM:     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:237:13)
8:18:31 PM: Error running command: Build script retu

I’ve installed with

$ npm install hexo-include-markdown --save

To solve this error, change netlify build & deploy, “Build command” to

hexo clean;echo "{}" > db.json;hexo generate

In the link:

https://app.netlify.com/sites/YOURSITE/settings/deploys

Sharing this solution so nobody has to waste 3 hours to fix this :slightly_smiling_face:

Thanks so much for closing that loop @dev! We very much appreciate it when you not only let the community know that you found an answer but also share it!

I wonder if you could check the empty database into your git repo, to not require that step? I don’t use hexo myself but I haven’t heard of other customers who do needing that workaround…

1 Like

I haven’t tested, but that likely works. The issue is only for the hexo-include-markdown plugin, hexo itself works fine out of the box :sunglasses: