Can't knit RMarkdown

I've been trying to knit my RMarkdown but I'm at wits' end as to why it doesn't work. Hoping that someone could help me make sense of the error message and how to solve it.

I'm using Macbook if it adds more context to this problem.

This is the error message:

sh: /private/var/folders/45/f1282hvs1s7b2zjgp3llt4cw0000gn/T/AppTranslocation/97CE6C20-F6C4-4CC2-BC6A-E78AB465EC5D/d/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc: Bad CPU type in executable Error in strsplit(info, "\n")[[1]] : subscript out of bounds Calls: ... pandoc_available -> find_pandoc -> lapply -> FUN -> get_pandoc_version In addition: Warning message: In system(paste(shQuote(path), "--version"), intern = TRUE) : running command ''/private/var/folders/45/f1282hvs1s7b2zjgp3llt4cw0000gn/T/AppTranslocation/97CE6C20-F6C4-4CC2-BC6A-E78AB465EC5D/d/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc' --version' had status 126 Execution halted

Can you give us a minimal code example that produces this error?

I added a few text in the standard RMarkdown file and when I knit it, the error message appears on my console.


title: "Untitled"
author: "Shaf"
date: "2023-09-25"
output: word_document

knitr::opts_chunk$set(echo = TRUE)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

Write text

summary(cars)

Including Plots

You can also embed plots, for example:

^ It looks find here but when I tried to knit or switch to 'Visual', there's an error message

When you switch to visual, adding chunks is done via insert menu.
I had the same problem when I tried to add my own chunks.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.