unable to install tidyverse with rmarkdown

**I just restarted using Rstudio after being inactive for a while. **

Here's what I had:

knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(openintro)

And here's what I got:
nitr::opts_chunk$set(echo = TRUE)

library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’:
.onAttach failed in attachNamespace() for 'tidyverse', details:
call: loadNamespace(x)
error: there is no package called ‘cli’

As you can see, I'm not quite sure what the problem is. It says that I'm missing a package called 'cli'
I tried downloading it through install.packages("cli") only it didn't seem to do anything:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘cli’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/cli’
    Warning in install.packages :
    installation of package ‘cli’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/ym/dw2nxdvd2pn8zwndc_06wmn80000gn/T/RtmphoDV8w/downloaded_packages’

I tried looking online, something about an issue with where my files are being directed to? Not quite sure.

Would appreciate some help on what the issue might be, and how to do it since I'm not really proficient in R or computers for that matter.

Problem was resolved!

This link helped instantly!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.