The tidyverse R package cannot be installed on macOS because one of its dependencies, ragg fails to compile with the following error:

clang++ -std=gnu++17 -I"/opt/homebrew/Cellar/r/4.4.1/lib/R/include" -DNDEBUG -I./agg/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/libtiff/4.6.0/include -I/opt/homebrew/opt/zstd/include -I/opt/homebrew/Cellar/xz/5.6.2/include -I/opt/homebrew/Cellar/jpeg-turbo/3.0.3/include -I'/opt/homebrew/lib/R/4.4/site-library/systemfonts/include' -I'/opt/homebrew/lib/R/4.4/site-library/textshaping/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include    -fPIC  -g -O2  -Wall -pedantic -fdiagnostics-color=always  -c agg/src/agg_vcgen_stroke.cpp -o agg/src/agg_vcgen_stroke.o
agg/src/agg_font_freetype.cpp:116:18: warning: variable 'len' set but not used [-Wunused-but-set-variable]
        unsigned len = 0;
                 ^
agg/src/agg_font_freetype.cpp:182:35: error: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not
            tags  = outline.tags  + first;
                    ~~~~~~~~~~~~~~^~~~~~~
1 warning and 1 error generated.
make: *** [agg/src/agg_font_freetype.o] Error 1
make: *** Waiting for unfinished jobs....
ERROR: compilation failed for package ‘ragg’

As of today, there is a pull request resolving the issue. You can install it using the remotes package. Then, install the tidyverse package:

install.packages("remotes")
remotes::install_github("alexreg/ragg", ref="fix-build")
install.packages("tidyverse")

Update

Jenny Bryan, a software engineer at Posit pointed out in the issue tracker of Tidyverse that reinstalling R with Homebrew’s --cask option may help:

brew uninstall R
brew install --cask R

With this, Tidyverse can be installed using the binary distribution.