This may be a temporary problem due to spatstat.data
and spatstat.utils
recently being updated at the CRAN repository hosting R packages. When new versions arrive at CRAN they are in "source" form with code that needs to be compiled to run on the computer. CRAN compiles these packages for Windows and OSX, but it takes a couple of days before they are available in the compiled (binary) version. It requires additional tools on your computer to be able to compile packages yourself and apparently you don't have the tools. No need to install the tools if you are able to wait a day or two for CRAN to make the binary versions available.
Alternatively you may install the compiled packages through the service r-universe.dev immediately:
install.packages(c("spatstat.utils", "spatstat.data"),
repos = "https://spatstat.r-universe.dev")