Hexo-theme-next: Mathjax : pandoc exited with code null (pandoc-2.9.2.1 already installed in my laptop)

Created on 7 Apr 2020  ·  21Comments  ·  Source: theme-next/hexo-theme-next

Please follow this Issue template to provide relevant information, such as source code repositories, blog links, and screenshots, which will help us investigate.
请按照此 Issue 模版提供相关信息,例如源码仓库、博客链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist

  • [x] I have read the relevant documents of Hexo and NexT.
  • [x] I am using the latest version of NexT.
  • [x] I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me.

Expected behavior

the server will start successfully when I run hexo server command

Actual behavior

$ hexo server
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
Unhandled rejection Error: 
[ERROR][hexo-renderer-pandoc] On G:\Users\yuhang.tao\Documents\GitHub\test\source\_posts\hello-world.md
[ERROR][hexo-renderer-pandoc] pandoc exited with code null.
    at Hexo.pandocRenderer (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo-renderer-pandoc\index.js:114:11)
    at Hexo.tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\method.js:15:34)
    at G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo\lib\hexo\render.js:75:22
    at tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromiseCtx (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:641:10)
    at _drainQueueStep (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

INFO  Have a nice day

yuhang.tao@Elf MINGW64 ~/test
$ hexo server
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 G:\Users\yuhang.tao\Documents\GitHub\test\source\_posts\hello-world.md
[ERROR][hexo-renderer-pandoc] pandoc exited with code null.
    at Hexo.pandocRenderer (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo-renderer-pandoc\index.js:114:11)
    at Hexo.tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\method.js:15:34)
    at G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo\lib\hexo\render.js:75:22
    at tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromiseCtx (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:641:10)
    at _drainQueueStep (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:456:21)
  • Links to demo site with this issue: N/A
    the server can't run ,so I can't supply any demo site
  • Links to repository or source code of the blog: N/A
    the blog is inite just now and hasn't adjusted anything.

Steps to reproduce the behavior

1.

 hexo init test
cd test
git clone https://github.com/theme-next/hexo-theme-next themes/next
hexo server

run normally

  1. change the hexo configure file theme's value to next
hexo server

run normally

3.

npm un hexo-renderer-marked
npm i hexo-renderer-pandoc
hexo server

run normally

  1. open hello-wold.md,then plus Ctrl+S
$ hexo server
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
Unhandled rejection Error: 
[ERROR][hexo-renderer-pandoc] On G:\Users\yuhang.tao\Documents\GitHub\test\source\_posts\hello-world.md
[ERROR][hexo-renderer-pandoc] pandoc exited with code null.
    at Hexo.pandocRenderer (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo-renderer-pandoc\index.js:114:11)
    at Hexo.tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\method.js:15:34)
    at G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo\lib\hexo\render.js:75:22
    at tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromiseCtx (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:641:10)
    at _drainQueueStep (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

Unhandled rejection Error: 
[ERROR][hexo-renderer-pandoc] On G:\Users\yuhang.tao\Documents\GitHub\test\source\_posts\hello-world.md
[ERROR][hexo-renderer-pandoc] pandoc exited with code null.
    at Hexo.pandocRenderer (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo-renderer-pandoc\index.js:114:11)
    at Hexo.tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\method.js:15:34)
    at G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo\lib\hexo\render.js:75:22
    at tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromiseCtx (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:641:10)
    at _drainQueueStep (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

Environment Information

Node.js and NPM Information

$ node -v && npm -v
v12.16.1
6.13.4

Package dependencies Information

$ npm ls --depth 0
[email protected] G:\Users\yuhang.tao\Documents\GitHub\test
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

Hexo Configuration

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Hexo
subtitle: ''
description: ''
keywords:
author: John Doe
language: en
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:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# 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:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
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: ''
  wrap: true
  hljs: false

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# 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
## Use post's date for updated date unless set in front-matter
use_date_for_updated: false

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: ''

NexT Configuration

I haven't change anything, just init it.~~~

Errata

# Math Formulas Render Support
math:
  # Default (true) will load mathjax / katex script on demand.
  # That is it only render those page which has `mathjax: true` in Front-matter.
  # If you set it to false, it will load mathjax / katex srcipt EVERY PAGE.
  per_page: true

  # hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.
  mathjax:
    enable: true
    # See: https://mhchem.github.io/MathJax-mhchem/
    mhchem: false

Other Information

Question

Most helpful comment

I got the same question in my hexo+next+travis.ci.
You can try to install the latest pandoc as below.

before_script:
   - wget https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-1-amd64.deb
   - sudo dpkg -i pandoc-2.10.1-1-amd64.deb
   - npm install hexo-renderer-pandoc --save  # for mathjax
   - npm install

This works for me.
Because hexo-renderer-pandoc is based on pandoc, so pandoc should be installed in advance.

All 21 comments

Thanks for opening this issue, maintainers will get back to you as soon as possible!

did u install the pandoc?

Thanks for your reply

as my question described, pandoc-2.9.2.1 already installed in my laptop.

Mathjax : pandoc exited with code null (pandoc-2.9.2.1 already installed in my laptop)

did u install the pandoc?

PS C:\Users\yuhang.tao> pandoc --version
pandoc.exe 2.9.2.1
Compiled with pandoc-types 1.20, texmath 0.12.0.1, skylighting 0.8.3.2
Default user data directory: C:\Users\yuhang.tao\AppData\Roaming\pandoc
Copyright (C) 2006-2020 John MacFarlane
Web:  https://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

NexT Configuration I haven't change anything, just init it.

how about enable this? https://github.com/theme-next/hexo-theme-next/blob/ca19a9d82dba6521ee7b9cb2befda51c6a1bd063/_config.yml#L503

I have enabled this option in my personal blog, I forget to add this description in this issue.

Now I reproduce it again

hexo init test
cd test
git clone https://github.com/theme-next/hexo-theme-next themes/next
npm un hexo-renderer-marked
npm i hexo-renderer-pandoc

then change the theme value to next

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

and change the mathjax option in NexT configure file

# Math Formulas Render Support
math:
  # Default (true) will load mathjax / katex script on demand.
  # That is it only render those page which has `mathjax: true` in Front-matter.
  # If you set it to false, it will load mathjax / katex srcipt EVERY PAGE.
  per_page: true

  # hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.
  mathjax:
    enable: true
    # See: https://mhchem.github.io/MathJax-mhchem/
    mhchem: false

last

hexo server

and git bash output below

yuhang.tao@Elf MINGW64 ~/test
$ hexo server
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 G:\Users\yuhang.tao\Documents\GitHub\test\source\_posts\hello-world.md
[ERROR][hexo-renderer-pandoc] pandoc exited with code null.
    at Hexo.pandocRenderer (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo-renderer-pandoc\index.js:114:11)
    at Hexo.tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\method.js:15:34)
    at G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\hexo\lib\hexo\render.js:75:22
    at tryCatcher (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromiseCtx (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\promise.js:641:10)
    at _drainQueueStep (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (G:\Users\yuhang.tao\Documents\GitHub\test\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

NexT Configuration I haven't change anything, just init it.

how about enable this?

https://github.com/theme-next/hexo-theme-next/blob/ca19a9d82dba6521ee7b9cb2befda51c6a1bd063/_config.yml#L503

Appendix:

here is another user who encountered similar problem mathjax problem but he choose just not use it.

maybe you can reproduce it just in a few minutes, as I think.

i have no idea about this. i am a pandoc user, it works fine.
waiting for other's help.

any attemps more?

following your previous advice, waiting for other's help


the problem still exists in my case and some others finisky.blog

well, maybe reinit and uninstal and install. wish

my issue described scene already starts from scratch ...

I run into a similar issue while building a Github Action for deployment, the issue turned out to be the Docker image for the action doesn't have pandoc installed.

That said, I have walked through your issue description and have tried to reproduce it:

hexo init test && cd test
git clone https://github.com/theme-next/hexo-theme-next themes/next
# enable the mathjax within /theme/next/_config.yml
hexo s

and everything looks good. At this point, the only problem I could think of is the distribution of pandoc might be different between Windows and macOS/Linux. Posting the versions on my box here in case it helps:

➜  test npm list | grep hexo
[email protected] /Users/***/***/playground/test
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected] deduped
│ │ ├── [email protected] deduped
│ │ ├── [email protected] deduped
│ ├─┬ [email protected]
│ ├─┬ [email protected]
│ ├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ ├─┬ [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
├── [email protected]
├─┬ [email protected]
└─┬ [email protected]

and

➜  test brew info pandoc
pandoc: stable 2.9.2.1 (bottled), HEAD
Swiss-army knife of markup format conversion
https://pandoc.org/
/usr/local/Cellar/pandoc/2.9.2.1 (183 files, 102.8MB) *
  Poured from bottle on 2020-04-19 at 22:32:44
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pandoc.rb
==> Dependencies
Build: cabal-install ✘, ghc ✘
==> Options
--HEAD
    Install HEAD version
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Analytics
install: 23,091 (30 days), 83,850 (90 days), 273,914 (365 days)
install-on-request: 15,650 (30 days), 58,280 (90 days), 193,445 (365 days)
build-error: 0 (30 days)

For me, I solved this issue via the following way:
go to https://github.com/jgm/pandoc/releases/tag/2.9.2.1, download the newest version.
For me, I used the pandoc 2.9.2.1.deb for my ubuntu 18.04 system, then install it:

sudo dpkg -i pandoc.deb

after that, when I run:

hexo clean && hexo g && hexo s

everything works fine.

GitHub
Universal markup converter. Contribute to jgm/pandoc development by creating an account on GitHub.

For me, I solved this issue via the following way:
go to https://github.com/jgm/pandoc/releases/tag/2.9.2.1, download the newest version.
For me, I used the pandoc 2.9.2.1.deb for my ubuntu 18.04 system, then install it:

sudo dpkg -i pandoc.deb

after that, when I run:

hexo clean && hexo g && hexo s

everything works fine.

GitHubjgm/pandocUniversal markup converter. Contribute to jgm/pandoc development by creating an account on GitHub.

Thanks, I will have a try.

GitHub
Universal markup converter. Contribute to jgm/pandoc development by creating an account on GitHub.

maybe you should install pandoc in your PC, then restart your PC.

you can try markdown-it-latex2img

I got the same question in my hexo+next+travis.ci.
You can try to install the latest pandoc as below.

before_script:
   - wget https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-1-amd64.deb
   - sudo dpkg -i pandoc-2.10.1-1-amd64.deb
   - npm install hexo-renderer-pandoc --save  # for mathjax
   - npm install

This works for me.
Because hexo-renderer-pandoc is based on pandoc, so pandoc should be installed in advance.

I got the same question in my hexo+next+travis.ci.
You can try to install the latest pandoc as below.

before_script:
   - wget https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-1-amd64.deb
   - sudo dpkg -i pandoc-2.10.1-1-amd64.deb
   - npm install hexo-renderer-pandoc --save  # for mathjax
   - npm install

This works for me.
Because hexo-renderer-pandoc is based on pandoc, so pandoc should be installed in advance.

slow download speed

I had the same problem. I solved the problem by pressing pandoc

Was this page helpful?
0 / 5 - 0 ratings