I think this is similar to a known issue that has been encountered before and answered on this forum.
You need to update yaml, rmarkdown, and knitr package
. One of them is too old to work with the other.
It also depends if you have an old version of R. You may need to update R or find the yaml and knir versions that works for your version of R
See this answer
and See similar issues:
https://community.rstudio.com/search?q=yaml%20eval.expr%20%3D%20TRUE