rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.87k stars 974 forks source link

render not found #1990

Closed data-al closed 3 years ago

data-al commented 3 years ago

After installing the latest rmarkdown package i have this issue trying to knit the default or any other .rmd :

[1] 127
Warning message:
In system(paste0("rmarkdown::render '", input, "'")) :
  'rmarkdown::render' not found

No document is produced. I'm guessing it's some kind of problem with finding the function of the package ? Any guidance is appreciated

xfun::session_info('rmarkdown') R version 4.0.2 (2020-06-22) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18363), RStudio 1.4.1074

Locale: LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
LC_TIME=English_United Kingdom.1252

Package version: base64enc_0.1.3 digest_0.6.27 evaluate_0.14 glue_1.4.2 graphics_4.0.2 grDevices_4.0.2 highr_0.8
htmltools_0.5.0 jsonlite_1.7.1 knitr_1.30 magrittr_1.5 markdown_1.1 methods_4.0.2 mime_0.9
rlang_0.4.8 rmarkdown_2.6 stats_4.0.2 stringi_1.5.3 stringr_1.4.0 tinytex_0.27 tools_4.0.2
utils_4.0.2 xfun_0.19 yaml_2.2.1
Warning messages: 1: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 2: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 3: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 4: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 5: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 6: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1


By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

cderv commented 3 years ago

After installing the latest rmarkdown package i have this issue trying to knit the default or any other .rmd :

Can you be more precise about what you are doing ?

What I did :

This will render the file correctly without any error.

I let you restart RStudio and R, and try again. Thank you.

dylangomes commented 3 years ago

In case it is helpful to anyone: I got this error today after an R version 4.0.4 update. I solved it by updating tinytex.

install.packages("tinytex")

cderv commented 3 years ago

This error is still puzzling to me. Can you share more on what you were rendering and what you have done ?

I am not sure to see how tinytex R package relates to

[1] 127
Warning message:
In system(paste0("rmarkdown::render '", input, "'")) :
  'rmarkdown::render' not found

Is this with a pdf file ? That would indeed require tinytex, but the error is not very informative. I would like to improve that.

If you can share anything to help us reproduce and / or identify the cause that would help.

Thank you

dylangomes commented 3 years ago

It is indeed puzzling. After updating R to the latest version (4.0.4), trying to knit a markdown doc (even the default Rmd, without added code) to pdf would throw that error (I know it says warning, but it will not knit). I closed and opened Rstudio again and the same thing. I updated the rmarkdown package, which didn't help, but then updated tinytex, and I now longer receive the error. Rmd -> pdf now has no issues.

As an aside, I did initially try knitting to html as well, which didn't work either at first. It now does work. I am assuming updating rmarkdown helped because I too cannot see how tinytex has anything to do with it, but I didn't check knitting to pdf in between those steps, so I cannot really say.. I wish I could be more informative.

cderv commented 3 years ago

Thanks for sharing. Let's see if other encounter the same thing.

JosephLazarus commented 3 years ago

I am having the same issue. [1] 127 Warning message: In system(paste0("rmarkdown::render '", input, "'")) : 'rmarkdown::render' not found

I've updated R and all the packages. Restarted R. But still I get this error message

cderv commented 3 years ago

@JosephLazarus Can you share your R version and R Studio version ? Also, do you have some steps to help us know when this issue arise ?

We need more information to be able to reproduce and fix this issue. I'll reopen in the meantime. thanks!

yihui commented 3 years ago

I quickly search for the code system(paste0("rmarkdown::render '", input, "'")) yesterday on both Github and Google, but didn't find it anywhere, so I have no idea who wrote this obviously wrong code and how it was executed. Since two people have reported the same problem, I guess the problem must be real, but we just don't know how to reproduce it.

cderv commented 3 years ago

Yes I did exactly the same thing but did not found any hit. I am really curious where this comes from. 🤔

cderv commented 3 years ago

Oh in fact I recall where I saw that! and it is the only hint I have:

RStudio IDE does this paste thing in here: https://github.com/rstudio/rstudio/blob/master/src/cpp/session/modules/rmarkdown/SessionRMarkdown.cpp#L536 and I think it comes from there.

However, this should only be activated (the pasting) if rmarkdown::render is not seen as a R call. This feature (calling system(paste0() is used for the new quarto rendering. However, it should not happen has rmarkdown::render should be able to evaluate in R.

So there is a state where rmarkdown is not available when this code is run and this cause this error I believe. I'll try to reproduce this state maybe.

What do you think ?

cderv commented 3 years ago

Yeah I can't reproduce - if you don't have rmarkdown installed, clicking the knit button will asked you to install it. And after that no error.

Maybe this is tied to a specific rstudio version and this has been fixed ? I tried daily and preview.

cderv commented 3 years ago

@data-al @dylangomes @JosephLazarus which version of RStudio are you using ? which OS are you on ?

Considering the above hint, it could be link a RStudio IDE and maybe the last version solve this. Can you share with us the information ? and maybe update to last released version of RStudio IDE ?

souckmi commented 3 years ago

Hello,

I encountered the same issue with the same error message few times already. Today I tried install.packages("tinytex") recommended @dylangomes and it helped. Restarting or updating had no effect. What I noticed is that the problem reoccurs when I try to knit a new rmarkdown. After that I am not able to knit any other older markdowns.

If it helps in any way:

xfun::session_info('rmarkdown') R version 3.6.2 (2019-12-12) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19041), RStudio 1.4.1103

Locale: LC_COLLATE=Czech_Czechia.1250 LC_CTYPE=Czech_Czechia.1250
LC_MONETARY=Czech_Czechia.1250 LC_NUMERIC=C
LC_TIME=Czech_Czechia.1250

Package version: digest_0.6.25 evaluate_0.14 glue_1.4.2
graphics_3.6.2 grDevices_3.6.2 highr_0.8
htmltools_0.4.0 jsonlite_1.7.2 knitr_1.31
magrittr_2.0.1 markdown_1.1 methods_3.6.2
mime_0.10 Rcpp_1.0.4 rlang_0.4.7
rmarkdown_2.6 stats_3.6.2 stringi_1.5.3
stringr_1.4.0 tinytex_0.30 tools_3.6.2
utils_3.6.2 xfun_0.22 yaml_2.2.1

Pandoc version: 2.11.2

Thank you Have a great day everyone

cderv commented 3 years ago

@souckmi sorry you also hit this issue.

Which is your RStudio version please ? Can you give us some step to try reproduce ? For now we don't succeed in reproducing this behavior on our side which makes it very difficult to debug

souckmi commented 3 years ago

My RStudio version is 1.4.1103.

Unfortunately I cannot say more than what was already said here. It seems to happen quite random, but if it occurs again I will try my best to give more information about what preceded.

cderv commented 3 years ago

Can you upgrade to last release bug fix version which is 1.4.1106 ? https://rstudio.com/products/rstudio/download/#download

This last version was released shortly after first 1.4 release as a bugfix version. It is possible that this comes from RStudio and it has been fixed already.

Thank you!

souckmi commented 3 years ago

Sure! I will let you know if I encounter it sometime anyway after that.

fytsai commented 3 years ago

I also encountered this issue today. It was solved after following @dylangomes suggestion to re-install tinytex. Thanks for the information. I use R 4.0.4, RStudio 1.4.1106, Windows 10.

cderv commented 3 years ago

Thanks for sharing @fytsai. It is really puzzling to me that re-installing tinytex (install.packages("tinytex") would fix such an issue - I am not sure how it relates. Anyway, since it helped you, I'll look in this direction. Thank you !

yihui commented 3 years ago

This is such a funny mystery to us. I can't imagine why the tinytex package could be relevant. If we can ever figure it out, it might become an inspiration for me to write a mystery book someday :)

themeaux commented 3 years ago

I was able to get it out of this error by reinstalling the htmltools and jsonlite packages.

cderv commented 3 years ago

by reinstalling the htmltools and jsonlite packages.

This now gets even weirder for us. It is really a funny mystery... how those package could be link to that ?

Our best guess was something related to RStudio version. 🤔 we have still no clue to where this comes from unfortunately.

wyattgarrett commented 3 years ago

I had a similar issue but by changing the file name was able to knit to pdf again.

cderv commented 3 years ago

What was your filename in the first place ? We are still gathering hints on what is happening as we don't have a clue yet of what the cause is. We're not able to reproduce yet so it is hard to fix.

Any information you think could be useful will help us.

And sorry you encountered this.

wyattgarrett commented 3 years ago

So the original file name was "Yahoo-Tumblr Case Study", and when I changed it to "Yahoo-Tumblr Case Study Final Version" I could suddenly knit to pdf again with out the render error. After doing a bit more work the error showed up again so I saved it as Version 2 and it was able to knit once again.

Prior to the error occurring I had tried import a bunch of packages like imager, shiny to find the best way to display an image. When I tried to load Bioconductor using the code below I got a spinning wheel and I think that was when I first wasn't able to knit to pdf.

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install(version = "3.12")

Before I got to the render error I first had to deal with another error. My installed packages like ggplot and xts returned "Error: package ‘ggplot2’ could not be loaded" so I tried to reinstall them, and then reinstalled R and Rstudio which solved the problem. Then when I tried to knit to pdf I ran into the render issue. So in a hail mary I changed the file name and everything worked, and I liked R and Rstudio again.

Hope this is helpful.

cderv commented 3 years ago

Wow thank for those details ! This is a really weird issue - nothing stands out on where this could come from really... It seems different that the other report so far.

I'll look back at our previous hints with your new information thanks

obrienjk commented 3 years ago

I found that upgrading xfun fixed this. A previous upgrade had left it behind (v0.19), I think because it was in use at the time.

When I upgraded it to v0.22 this problem disappeared. None of the suggestions above had worked previous to that.

cderv commented 3 years ago

Thanks for sharing - we'll try to reproduce with the new information. We have a new solution at each now post 😓 What a weird issue !

noemiepichon commented 3 years ago

Hi everybody. Thanks for the discussion. I think I have an idea why we encounter this issue and why we solve it every time with a different solution.

I have this error message when the access to my packages library is blocked or has changed. I had this error message after disconnecting or reconnecting with a VPN which, for some reason, changed the path access to my library. I thought the library storage was local, but it wasn't. You can check where R stores your library with this command: .libPaths()

So to sum up, you get this error when one or more packages used in markdown (tinytex, htmltools, rmarkdown...) are not accessible anymore. You can therefore fix the issue by reinstalling them... or changing/restoring the path to your library.

I hope it helps.

cderv commented 3 years ago

Oh that is of great help. I think that would explain it !

As I mentionned in https://github.com/rstudio/rmarkdown/issues/1990#issuecomment-801327287 , this could come from RStudio IDE. There is a special case handled when the function to knit is not detected as an R function. By default the function to knit is rmardown::render but it could be defined to anything else with the knit: YAML field, and could be used with external software.

Code from RStudio IDE https://github.com/rstudio/rstudio/blob/ca079b3c35c2bcfe44e39a75d52e032b1323c9bb/src/cpp/session/modules/rmarkdown/SessionRMarkdown.cpp#L530-L538

So when RStudio IDE detect that what is supposed to be used to render a document is not an R function, it will build call using system().

So if your library is not available somehow, rmarkdown::render is not seen as an R function, so the IDE will assume it is an external program and then build a call with system() - which is the error seen above.

Thanks to your information, I am know convinced this is a RStudio IDE thing - I don't know if it could be handled differently by the IDE.

Everyone should check this library path thing. Maybe there are other situation when this "is it a R function" detection is not working.

cderv commented 3 years ago

This is happening again and reported in https://community.rstudio.com/t/recent-upgrade-causes-knit-not-to-work/105200/7

This time it is because the library is corrupted: rmarkdown is installed but can load (library(rmarkdown) is failing) and so rmarkdown::render is not seen by the IDE as a R function - hence passed to system() like a program. Reinstalling corrupted packages helped solves it.

We are closer to a good understanding and @yihui I think we may need to see with the IDE team if we can catch the error better to avoid this cryptic one.

yihui commented 3 years ago

@cderv Yes, the IDE needs to try harder to understand why library(markdown) fails. If the rmarkdown package or any of its dependencies is corrupt, it should not call system() but prompt users to reinstall these packages just like when any of them are not installed:

image

(you get this dialog box when rmarkdown is not installed or its version is too low)

cderv commented 3 years ago

I'll open an issue is the IDE repo now that we know more about it.

tombeesley commented 3 years ago

Just to report, I had this same issue (i.e., 'rmarkdown::render' not found).

Library(rmarkdown) failed and I had to reinstall dependent packages. Then the original error was resolved.

yihui commented 3 years ago

FYI I have an internal function xfun:::broken_packages() that I often use by myself to reinstall broken packages (in case xfun is broken itself, first do install.packages('xfun')).

cderv commented 3 years ago

I have an internal function xfun:::broken_packages()

🤯 I would have used this function a lot - This is really useful! So many things hidden. Too bad it is not working on Windows (forking not available) - I may try to fix it.

yihui commented 3 years ago

@cderv I just documented and exported it. I also removed the use of parallel.

yirangu commented 3 years ago

I encountered the same issue as well and this is funny because it occurs after I tried to debug under the guide of Yihui's website... Hahaha I could knit to word and HTML but I couldn't knit to pdf before I tried to debug it. And now I can't knit to any of them. I'll try to delete RStudio and reinstall the latest version right now. Hope things could work.

yirangu commented 3 years ago

Hahaha the reinstall of RStudio really worked! Just remember to reinstall both the RStudio and the LaTex again.

PythonCoderUnicorn commented 3 years ago

Hello, I have this issue, I will try to give as much detail to help.

R history :

install.packages('flexdashboard')
install.packages('shiny')
install.packages("remotes")
remotes::install_github("rstudio/bslib")
library(ggplot2)
renderPlot({
ggplot(mpg, aes(displ, hwy)) +
geom_point() + geom_smooth()
})
?renderPlot
??renderPlot
library(shiny)
renderPlot({
plot(pressure, col = thematic::thematic_get_option("accent"))
})
library(flexdashboard)
install.packages('flexdashboard')
library(flexdashboard)
library(flexdashboard)
install.packages('markdown')
library(flexdashboard)
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
library(flexdashboard)
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
library(flexdashboard)
library(rlang)
sessionInfo()
remove.packages(rlang)
remove.packages('rlang')
install.packages('rlang')
install.packages("rlang")
library(flexdashboard)
library(rlang)
sessionInfo()
remove.packages("rlang")
library(flexdashboard)
install.packages('rlang 0.4.11.9000')
install.packages('markdown')
install.packages('rlang')
install.packages("rlang")
install.packages("rmarkdown")
knitr::opts_chunk$set(echo = TRUE)
summary(cars)
plot(pressure)
install.packages('knitr')
install.packages("knitr")
install.packages("knitr")
install.packages("knitr")
install.packages("knitr")
install.packages("knitr")
install.packages("knitr")
install.packages("knitr")
install.packages('xfun')
install.packages("xfun")
install.packages("xfun")`

Terminal

> sh: rmarkdown::render: command not found
Warning message:
In system(paste0("rmarkdown::render '", input, "'")) :
  error in running command`
> library(flexdashboard)
  Error: package or namespace load failed for ‘flexdashboard’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
   namespace ‘rlang’ 0.4.11 is already loaded, but >= 0.4.11.9000 is required`

> install.packages('markdown')
  trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/markdown_1.1.tgz'
  Content type 'application/x-gzip' length 198809 bytes (194 KB)
  ==================================================
  downloaded 194 KB

> The downloaded binary packages are in
    /var/folders/1g/ylfgpc813936cj34f1zs1h1h0000gn/T//RtmpdUw2cP/downloaded_packages
> install.packages('rlang')
Error in install.packages : Updating loaded packages

Restarting R session...

> install.packages("rlang")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/rlang_0.4.11.tgz'
Content type 'application/x-gzip' length 1328785 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

The downloaded binary packages are in
    /var/folders/1g/ylfgpc813936cj34f1zs1h1h0000gn/T//Rtmp10BDdY/downloaded_packages
> install.packages("rmarkdown")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/rmarkdown_2.9.tgz'
Content type 'application/x-gzip' length 3635877 bytes (3.5 MB)
==================================================
downloaded 3.5 MB

The downloaded binary packages are in
    /var/folders/1g/ylfgpc813936cj34f1zs1h1h0000gn/T//Rtmp10BDdY/downloaded_packages
> knitr::opts_chunk$set(echo = TRUE)
> summary(cars)`

## the cars data loads inside the Rmd file but knit keeps giving errors.  The message box goes into a loop of asking to restart the session, only clicking No does it try to install the package

> `install.packages("knitr")
  trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/knitr_1.33.tgz'
  Content type 'application/x-gzip' length 1410317 bytes (1.3 MB)
  ==================================================
  downloaded 1.3 MB

The downloaded binary packages are in
    /var/folders/1g/ylfgpc813936cj34f1zs1h1h0000gn/T//Rtmpix9XqG/downloaded_packages
> install.packages('xfun')
Error in install.packages : Updating loaded packages

Restarting R session...

> install.packages("xfun")
Error in install.packages : Updating loaded packages
> install.packages("xfun")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/xfun_0.24.tgz'
Content type 'application/x-gzip' length 340207 bytes (332 KB)
==================================================
downloaded 332 KB

> The downloaded binary packages are in
    /var/folders/1g/ylfgpc813936cj34f1zs1h1h0000gn/T//Rtmp3M0ZRX/downloaded_packages`

## and one more time installing/updating rmarkdown
>  `install.packages('rmarkdown')
  trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/rmarkdown_2.9.tgz'
  Content type 'application/x-gzip' length 3635877 bytes (3.5 MB)
  ==================================================
  downloaded 3.5 MB

> The downloaded binary packages are in
    /var/folders/1g/ylfgpc813936cj34f1zs1h1h0000gn/T//Rtmp3M0ZRX/downloaded_packages

Hope this helps find the error. I just wanted to try out a flexdashboard with the bslib theme.

I uninstalled, reinstalled rlang just in case that was missed.

cderv commented 3 years ago

Hi @PythonCoderUnicorn,

Please next time, format your issue correctly so that it is correctly readable (https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax). For this time, I edited your post.

The issue is due to a corrupted packages library. In your case it could have been rlang but maybe other. library(rmarkdown) may thrown an error in your case. And the IDE does not handle this well for now (rstudio/rstudio#9435)

Please reinstall rmarkdown correctly.

You can install the last version of xfun and use xfun::broken_packages(reinstall = TRUE) to check for corrupted packages and reinstall them. This could be long as it will test all the installed package. You could just try library(rmarkdown) and follow the error to reinstall the packages with issue.

If library(rmarkdown) is working well, this is something else with the library going on. But as stated above, this is an issue with the IDE and an issue is opened there.

FrancoisJMalan commented 3 years ago

The same happened to me now as well I get this message: [1] 127 Warning message: In system(paste0("rmarkdown::render \"", input, "\"")) : 'rmarkdown::render' not found

I have the latest version of RStudio (Version 1.4.1717), reinstalled all the packages etc. The only thing that eventually worked was to reinstall RStudio entirely.

cderv commented 3 years ago

There is now a fix pushed in RStudio IDE codebase. If everything is ok, it should be available soon in the next daily build of Rstudio.

PythonCoderUnicorn commented 3 years ago

@cderv Thanks, I ran the xFun line and it said 'pkgs' and 'lib' not found. I removed /installed rmarkdown. Restared Rstudio after clearing all history. it works now (knits), even though it defaults to notepad html but easily fixed. Thanks !

Brufico commented 3 years ago

Hello, I just had the issue described, after upgrading to the latest version of R and Rstudio

After reading the other comments, when I tried library(rmarkdown), i finally got the error:

Error: le chargement du package ou de l'espace de noms a échoué pour ‘rmarkdown’ : le package ‘evaluate’ a été installé avant R 4.0.0 : veuillez le réinstaller, s'il-vous-plait

I obeyed the message and reinstalled evaluate, then I got many more similar errors like: Error: le package ‘yaml’ a été installé avant R 4.0.0 : veuillez le réinstaller, s'il-vous-plait

Each time, I reinstalled more packages, and now it works

I have had many of this kind of errors today in R script files, probably because after switching from R 3.something to R 4.1.1, I copied my entire old package library into the new one, and updated. Updating seems not to be enough for R 4.1.1.

It might be the cause for the 'rmarkdown::render not found issue: somewhere along the way, a package cannot be loaded by R and causes the error. the offending package might be anything, and that could be why different people reinstall different packages and still unblock the system.

Could that help? Best.

cderv commented 3 years ago

It might be the cause for the 'rmarkdown::render not found issue: somewhere along the way, a package cannot be loaded by R and causes the error. the offending package might be anything, and that could be why different people reinstall different packages and still unblock the system.

Yes I also think this is the case ! Your story complete the one above and confirm this.

As I mentioned in https://github.com/rstudio/rmarkdown/issues/1990#issuecomment-870622952, it should be fixed in last RStudio version. But we did not had confirmation yet.

And as Yihui mentioned in https://github.com/rstudio/rmarkdown/issues/1990#issuecomment-853894243, there is a function xfun::broken_packages() that should help to detect and reinstall broken packages as you found. This function could take time to reinstall everything.

For the context, the issue you have while upgrading R is because Packages needs to be rebuild when a Major version of R changes (even when a minor version it could be a good idea).

Thanks for sharing ! That is helpful for us and others !

alanryder commented 3 years ago

I am an infrequent Markdown user and I have just stumbled across the same issue. I am running R 4.1.1 and RStudio 2021.09.0 build 351 (which I uninstalled and reinstalled). I have updated ALL packages. I ran xfun::broken_packages() and it complained only that the package translations could not be updated. When I Knit a markdown document from the RStudio command line I get a rendered html document. When I execute knitr::knit(markdown_file.Rmd), it knits the file into markdown_file.md. However, when I execute markdown::render(markdown_file.md) I get: Error: 'render' is not an exported object from 'namespace:markdown'.

cderv commented 3 years ago

However, when I execute markdown::render(markdown_file.md) I get: Error: 'render' is not an exported object from 'namespace:markdown'.

I don't think this is related to this issue. The error you see is saying that the markdown R package (https://github.com/rstudio/markdown) has not render() functions. markdown::render() does not exists. The render() functions for Rmd documents lives in the rmarkdown package (this repo https://github.com/rstudio/rmarkdown)

Please try the correction call rmarkdown::render()

cderv commented 3 years ago

I'll close this issue because the new release of RStudio IDE contains a fix for this.

Please install newer version of RStudio if you stumble accross this. Version above 20201.09.0+351.

PatrickRWright commented 2 years ago

FYI I have an internal function xfun:::broken_packages() that I often use by myself to reinstall broken packages (in case xfun is broken itself, first do install.packages('xfun')).

I also had the issue (RStudio Server Version 1.4.1717) and tried loading rmarkdown:

> library(rmarkdown)
Error: package or namespace load failed for ‘rmarkdown’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘xfun’ 0.24 is being loaded, but >= 0.27 is required

Updating xfun install.packages("xfun") (currently version 0.29) allowed me to knit again.