Hexo配置问题-Pandoc

Pandoc 的问题

Error: spawn pandoc ENOENT

1
2
3
4
5
6
7
8
9
10
events.js:183
throw er; // Unhandled 'error' event
^

Error: spawn pandoc ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

解决方案: 应该是未找到pandoc的原因,解决方案是设置相关PATH, 或者安装pandoc

Error: pandoc exited with code 2: –smart/-S has been removed. Use +smart or -smart extension instead.

1
2
3
4
5
6
7
8
9
Error: pandoc exited with code 2: --smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.

at ChildProcess.<anonymous> (/home/arxan/go_project/src/blog_hexo/node_modules/hexo-renderer-pandoc/index.js:73:20)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

Pandoc 2.0 移除了 –smart/-S 参数, 需要修改为 pandoc -f markdown+smart -t markdown-smart. 或者重新安装1.x版本的pandoc

修改hexo-renderer-pandoc@0.1.1参数的方法为:

进入node_modules/hexo-renderer-pandoc/index.js line43, change

1
var args = [ '-f', 'markdown', '-t', 'html', math, '--smart']

to

1
var args = [ '-f', 'markdown+smart', '-t', 'html', math]
打赏