Unable to install any packages?

Hi All,

I am no longer able to install or update any packages, can anyone help me with fixing this problem?

Below is the error code I get for ggplot2, for example. These errors are very similar across all the packages I try to install/update.

Apologies if I've missed something completely obvious!

> install.packages("ggplot2")

  There is a binary version available but the source version is later:
        binary source needs_compilation
ggplot2  2.2.1  3.0.0             FALSE

installing the source package ‘ggplot2’

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  7 2780k    7  220k    0     0 100 2780k  100 2780k    0     0  1943k      0  0:00:01  0:00:01 --:--:0:-- 1944k
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018c.1.0/zoneinfo/Australia/Melbourne'
* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error : object ‘enexprs’ is not exported by 'namespace:rlang'
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ggplot2’
Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/7_/n0mh56pn075068r_s9ntrj0r0000gn/T/RtmpchF5hw/downloaded_packages’

Thanks so much in advance <3

It looks like rlang may be out of date. Try running update.packages() before installing ggplot.

This should really get taken care of automatically, but setting minimum dependency versions correctly as a package maintainer is a pain/hard.

Happily, it looks like this has been taken care of on the GitHub version, whose DESCRIPTION file sets a minimum rlang version, unlike the CRAN one. That doesn't really help you now, but will eventually make this problem disappear.

Thanks for the response.

I tried doing this just now but had no success.

The majority of packages I try to update using update.packages() give me the error
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

ERROR: compilation failed for package ‘xy’. Any ideas why this is?

This means you either need to install or update your xcode or xcode CLT (see StackOverflow thread, below).

/* aside: since this is happening with all packages, and isn't tidyverse-specific, I'm going to move this into General */

1 Like

Thanks so much for your help!

1 Like

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

I have the same problem as above with Mac lately. I tried to install, update some packages but all failed to do so. My xcode tool is updated. Please let me know if there is a straight solution to this. Is it supposed to be a bug from Rstudio? I never run into this problem before.

What's the actual error message?