-1

I am using R for windows on RStudio. I recently changed the name of User directory for a reason, and it seems that the change is causing a problem in knitting Rmd file.

If I try to knit Rmd file, the following error massage appears:

Error: invalid version specification 'find' In addition: Warning message: In system(paste(shQuote(path), "--version"), intern = TRUE) : running command '"C:/PROGRA~3/CHOCOL~1/bin/pandoc.exe" --version' had status 65535 Execution halted

I entered '"C:/PROGRA~3/CHOCOL~1/bin/pandoc.exe" --version' in cmd, it says

Cannot find file at 'c:\users\MY OLD USER NAME\appdata\local\pandoc\pandoc.exe'

So, I guess that knitr or pandoc is trying to find the wrong path. How can I fix the problem? How can I change the path?

Here is the list of what I have tried:

  • Uninstalled R and RStudio, and then installed them.
  • Then, I installed all the packages needed by install.packeges.
    • Thus, I am using the latest version of R, RStudio, and packages.
  • Searched 'pandoc' in registry editor, and tried to find the old path (but I couldn't)
2
  • How exactly did you change the name of the directory? Did you simple rename it? Did you modify environment variables like %USERPROFILE%? Did you consider creating a new user profile instead of using the (broken?) profile with the (somehow) changed directory name?
    – CL.
    May 2, 2020 at 16:03
  • >CL Thanks for your response, I used registory editor to rename User directory, and modified the name of environment variables. But, the suggestion by Yihui Xie below solved the problem!
    – user789100
    May 3, 2020 at 5:41

1 Answer 1

1

It seems you installed Pandoc by yourself through Chocolatey, and the installation was broken after you changed the name of your User directory.

First, you do not have to install Pandoc separately if you are using RStudio, because RStudio has bundled Pandoc with it.

If you have to install Pandoc for some reason, you may need to reinstall it (perhaps you have to reinstall Chocolatey, too).

choco uninstall pandoc
choco install pandoc
1
  • You are right, I installed Pandoc through Chocolatey (I don't remember why). And, 'choco uninstall pandoc' solved the problem, thanks!
    – user789100
    May 3, 2020 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.