When I attempt to create a new Rmarkdown file I am presented with a pop-up window that says:
"Install Require Packages: Creating R Markdown documents requires updated versions of the following packages: jsonlite, markdown, rmarkdown. Do you want to install these packages>?"
I click Yes. They install. Then I re-attempt creating a new Rmarkdown file and the same window pops-up.
You are trying to install the latest package versions that currently are only available as source code, for that you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems. https://mac.r-project.org/tools/
You could also try installing binary versions by answering "no" when you are asked whether to install from source.