Hexo生成pandoc报错解决方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
INFO  Start processing
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error:
[ERROR][hexo-renderer-pandoc] On /home/xxxxx/blog/source/_drafts/TensorFlow2-0学习笔记.md
[ERROR][hexo-renderer-pandoc] pandoc exited with code null.
at Hexo.pandocRenderer (/home/xxxxx/blog/node_modules/hexo-renderer-pandoc/index.js:114:11)
at Hexo.tryCatcher (/home/xxxxx/blog/node_modules/bluebird/js/release/util.js:16:23)
at Hexo.<anonymous> (/home/xxxxx/blog/node_modules/bluebird/js/release/method.js:15:34)
at /home/xxxxx/blog/node_modules/hexo/lib/hexo/render.js:75:22
at tryCatcher (/home/xxxxx/blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/xxxxx/blog/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/xxxxx/blog/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromiseCtx (/home/xxxxx/blog/node_modules/bluebird/js/release/promise.js:641:10)
at _drainQueueStep (/home/xxxxx/blog/node_modules/bluebird/js/release/async.js:97:12)
at _drainQueue (/home/xxxxx/blog/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/xxxxx/blog/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/xxxxx/blog/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:456:21)
events.js:292
throw er; // Unhandled 'error' event
^

Error: EACCES: permission denied, open '/home/xxxxx/blog/db.json'
Emitted 'error' event on WriteStream instance at:
at /home/xxxxx/blog/node_modules/graceful-fs/graceful-fs.js:295:14
at /home/xxxxx/blog/node_modules/graceful-fs/graceful-fs.js:325:16
at FSReqCallback.oncomplete (fs.js:156:23) {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/home/xxxx/blog/db.json'
}

https://github.com/jgm/pandoc/releases 下载最新版pandoc,使用dpkg -i安装即可

此问题在Ubuntu上出现,Windows下老版本无此问题

centos下安装,anaconda自带pandoc版本太低,也需要替换

1
2
3
4
5
wget https://github.com/jgm/pandoc/releases/download/2.14.0.3/pandoc-2.14.0.3-linux-amd64.tar.gz

tar -xvf pandoc-2.14.0.3-linux-amd64.tar.gz

ln -s /root/pandoc-2.14.0.3/bin/pandoc /usr/bin/pandoc