Rmarkdown Pandoc error after update to macOS Catalina (10.15)

I had a simple shell script that ran the following:

Rscript -e 'rmarkdown::render("index.Rmd")'

After updating to macOS Catalina (10.15) I started getting the following error:

Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).

However, if I knit index.Rmd directly in RStudio, it works fine. And, when I check the pandoc version I get:

rmarkdown::pandoc_version()
[1] ‘2.3.1’

But, if I run the following in terminal I get:

Rscript -e 'rmarkdown::pandoc_version()'
NULL

Again, I can knit the file directly in RStudio, but I'm curious why my shell script stopped working and if anyone knows how to fix it.

I also posted this question on SO here.

Hi @brad.cannell,

Do you have pandoc installed? Can you try running:

Rscript -e 'rmarkdown::pandoc_exec()'

or right in the terminal:

which pandoc
pandoc --version

Found this information which perhaps explains the issue:

A recent version of Pandoc (>= 1.12.3) is required to use the rmarkdown package. RStudio also automatically includes this so you do not need to download Pandoc if you plan to use rmarkdown from the RStudio IDE.
If not using the RStudio IDE, you’ll need to install Pandoc for your platform.

You probably need to install a system version of pandoc if you are planning to render outside of RStudio.

If you use homebrew on your Mac, you can run:

brew install pandoc

Thank you, @mattwarkentin. I don't remember manually installing Pandoc with Homebrew in the past, but it fixed my issue. Thanks again!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.