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


R version 3.5.1 (2018-07-02) Platform: x86_64-apple-darwin15.6.0
(64-bit) Running under: macOS High Sierra 10.13.3

makeCluster(detectCores() - 1)

Output in R:

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

How can I solve this issue? Thank you!

I see you've also posted this on StackOverflow, please see our FAQs re. cross-posting (at a minimum, you should always include a link to the other post)

From: FAQ: Is it OK if I cross-post?

  • First, avoid cross-posting to other websites.
  • If you must, always link to those other posts, and update with any solutions.

Why? - Not doing so is generally considered to be rude - someone might spend their time answering the question on StackOverflow, for example, when it’s already been answered here. And once you have an answer in one place, it's polite to update all of your questions accordingly.

Hi Everyone, I have the same problem with markdown not knitting to html, this has happened all of a sudden and I can not put my finger on anything that could have triggered the problem (up until then all my markdowns were knitting correctly). I have bypassed the error by downloading pandoc on the command line using homebrew. I can now produce a html document by typing
rmarkdown::render("file.Rmd", "html_document")
Please let me know if you know a better solution.