Cannot install ggplot2 in R "installation of package ‘ggplot2’ had non-zero exit status"

Hi everyone,

I'm trying to install the ggplot2 package in R by using the command 'install.packages("ggplot2")'. I am using R 4.2.1 and Rstudio build 463 on MacOS 13.5.1. Whenever i try, i get the following messages in the console.


Can any of you help me install the package ?
Thanks :slight_smile:

Hi @legabgob

Install fansi packages, and repeat the process.

install.packages('fansi')

I'm getting a similar issue even when trying to install fansi

Seems like you don't have the tools to compile packages installed, so choose the older binary version, instead of the newer source version.

Thank you for your answer ! Do you by any chance know which tools have to be installed in order to install the source packages ?

For R 4.2.1 on macOS you only need the Xcode command line tools in general. Plus for some packages (not for fansi) you need extra libraries from Binaries of libraries and tools for macOS or from another source like homebrew.

1 Like

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.