Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown preview in emacs fails: (pandoc?) error 127

I am trying to create a markdown document in Emacs *.

It does highlight the syntax etc. and goes into Markdown mode (I am not quite sure if I installed that package or if it is standard issue)..

Problem:

When I try to create a preview (either via C-c C-c p or the GUI), it returns this error code:

markdown failed with exit code 127

Question

  • What does this error tell me? Is there a way to get a more complete error message?

  • The docs for markdown-mode suggest that it calls on an external library such as pandoc, which I have installed. According to these SO questions, pandoc can return this error code, but I could not quite establish what it means.

  • How do I fix this / what documentation should I go to?

I am pretty new to Emacs, so anything will help. Thanks!

*Emacs version 25.3.1 on a Mac (Sierra 10.12.6)

like image 538
patrick Avatar asked May 21 '18 16:05

patrick


1 Answers

The simplest fix is likely to install the markdown package using your package manager.

I fixed this error for myself with:

$ brew install markdown

(on MacOS Mojave, at the bash command line). Brew installed the "bottle" markdown-1.0.1.mojave.bottle.tar.gz, after which C-c C-c p or M-x markdown-preview worked to export the markdown file and open a browser window showing the exported file.

On an Ubuntu 19 (and now 20.04 and 21.10) system, sudo apt install markdown worked too.

You could do the same thing with a symlink to pandoc's markdown, but a) this just worked, b) there's no fiddling with a potentially messed up manually created symlink, and c) it's tiny (a 36 KByte executable). Pandoc's markdown may support more "modern" markdown, though.

like image 179
Some Guy on the Internet Avatar answered Nov 08 '22 00:11

Some Guy on the Internet