Error in install.packages("tidyverse")

Hi! I tried to install tidyverse in my R studio , but it shows couples of error !

install.packages("tidyverse")

Blockquote

also installing the dependencies ‘gargle’, ‘openssl’, ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘rvest’

There are binary versions available but the source versions are later:
binary source needs_compilation
gargle 0.4.0 1.2.0 FALSE
openssl 1.4.1 2.0.2 TRUE
googledrive 1.0.0 2.0.0 FALSE
googlesheets4 0.1.1 1.0.0 FALSE
httr 1.4.1 1.4.3 FALSE
rvest 0.3.5 1.0.2 FALSE
tidyverse 1.3.0 1.3.1 FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
installing the source packages ‘gargle’, ‘openssl’, ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘rvest’, ‘tidyverse’

  • installing source package ‘openssl’ ...
    ** package ‘openssl’ successfully unpacked and MD5 sums checked
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    Using PKG_CFLAGS=-I/private/var/folders/q_/mkl7pvmd38vb6xj303pfr66c0000gn/T/Rtmp5RtYfF/R.INSTALL189659e000e2/openssl/.deps/include
    --------------------------- [ANTICONF] --------------------------------
    Configuration failed because openssl was not found. Try installing:
  • deb: libssl-dev (Debian, Ubuntu, etc)
  • rpm: openssl-devel (Fedora, CentOS, RHEL)
  • csw: libssl_dev (Solaris)
  • brew: openssl (Mac OSX)
    If openssl is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
    is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
    R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
    -------------------------- [ERROR MESSAGE] ---------------------------
    ./configure: line 57: -I/private/var/folders/q_/mkl7pvmd38vb6xj303pfr66c0000gn/T/Rtmp5RtYfF/R.INSTALL189659e000e2/openssl/.deps/include: No such file or directory

ERROR: configuration failed for package ‘openssl’

  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/openssl’
    Warning in install.packages :
    installation of package ‘openssl’ had non-zero exit status
    ERROR: dependency ‘openssl’ is not available for package ‘httr’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/httr’
    Warning in install.packages :
    installation of package ‘httr’ had non-zero exit status
    ERROR: dependency ‘httr’ is not available for package ‘gargle’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/gargle’
    Warning in install.packages :
    installation of package ‘gargle’ had non-zero exit status
    ERROR: dependency ‘httr’ is not available for package ‘rvest’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rvest’
    Warning in install.packages :
    installation of package ‘rvest’ had non-zero exit status
    ERROR: dependencies ‘gargle’, ‘httr’ are not available for package ‘googledrive’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/googledrive’
    Warning in install.packages :
    installation of package ‘googledrive’ had non-zero exit status
    ERROR: dependencies ‘gargle’, ‘googledrive’, ‘httr’ are not available for package ‘googlesheets4’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/googlesheets4’
    Warning in install.packages :
    installation of package ‘googlesheets4’ had non-zero exit status
    ERROR: dependencies ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘rvest’ are not available for package ‘tidyverse’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/tidyverse’
    Warning in install.packages :
    installation of package ‘tidyverse’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/q_/mkl7pvmd38vb6xj303pfr66c0000gn/T/RtmpCwKhBk/downloaded_packages’

Blockquote

my R studio is the latest version :
RStudio 2022.07.0+548 "Spotted Wakerobin" Release (34ea3031089fa4e38738a9256d6fa6d70629c822, 2022-07-06) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4_0) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36

Since you are using a very old R version (this is different than your RStudio version) you are forced to install the latest package versions from source, for doing 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/

Besides that, you are also missing a system dependency

You need to install openssl in your system, if you have Homebrew you can do it with this command from a system terminal

brew install openssl

I would strongly recommend updating your R version though, you can download the latest version from here.

https://cran.r-project.org/bin/macosx/

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.