Mac Unable to Load "vctrs" Package

About two hours ago, all of my code was working fine, and all of a sudden (without having changed anything) my computer (which is a Mac) is unable to load tidyverse or ggplot2, and it is saying it's due to the fact that the package 'vctrs' is missing. When I try to install this package, it gives me this error.

Error Message:

`installing the source package ‘vctrs’
trying URL '' Content type 'application/x-gzip' length 959562 bytes (937 KB)
downloaded 937 KB

installing source package ‘vctrs’ ... ** package ‘vctrs’ successfully unpacked and MD5 sums checked ** using staged installation ** libs xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun ERROR: compilation failed for package ‘vctrs’
removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/vctrs’ Warning in install.packages : installation of package ‘vctrs’ had non-zero exit status
The downloaded source packages are in ‘/private/var/folders/gw/m0wl7fh17n59_zcbrnc5s6mw0000gn/T/RtmprjCBXC/downloaded_packages’`

I have not found a solution online, and I am worried I will mess up my computer more if I start going into XCode. I have tried updating all of my packages, I have updated my computer, I have deleted and reinstalled RStudio, and I have downloaded an older version of RStudio. None of these suggested solutions have fixed anything. I would appreciate any help or insight!

The latest version of the vctrs package is only available for your R version as source code which requires compilation, so Xcode is mandatory if you want to install it under this conditions.

Some alternatives are installing the latest binary version of vctrs available for your R version and see if tidyverse loads or updating your R version so you can get access to precompiled binaries for the latest package versions

You should get an option like this, just say no!

This topic was automatically closed 21 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.