简体   繁体   中英

Markdown won't knit pdf or html, gives Fatal error: creating temporary file for '-e' failed"

I can't seem to knit any markdown Rmd files to html or pdf. This happened all of a sudden and on Rmds I've used successfully for years. I tried downloading from repos, and the same problem exists. It seems to be on my computer but not on colleagues that download repos, so very strange. I updated yaml, rmarkdown, knitr packges, reinstalled new versions of Rstudio, R and still no solution.

When I try to knit, I get a prompt saying "Install Required Package: Rendering R Markdown documents requires and updated version of the rmarkdown pakage. Install now?". If I click no, everything halts. If I click yes, I get the following error immediately:

Fatal error: creating temporary file for '-e' failed

I have rmarkdown package v. 1.1 installed, and I uninstalled and reinstalled it, yet I still get this prompt. No clue what's happening or why this would start out of nowhere. I tried pulling from repo and running on a new computer and it will knit so it seems like it isn't in what is coded, but perhaps something loaded/not...? At a loss

Thank you for any help!

I had to get help from community.rstudio for this one https://community.rstudio.com/t/r-markdown-wont-knit-gives-fatal-error-creating-temp-file/43901/11

But it seems that somehow my.Renviron was trying to write to a location that didn't exist or it didn't have permission. No clue as to how this happened, but resolving it was simple... once we identified this was the problem.

(1) First make sure pandoc is downloaded and running for knitr to work (in terminal)...

pandoc -v

This will return a version of pandoc loaded on your machine

(2) If still having trouble remove the.Renviron file (again in command line)

### inspect .Renviron
cat .Renviron

### remove .Renviron
rm .Renviron

This last step is what worked for me, now I can once again knitr all my markdown.Rmds

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM