You haven't said, but my assumption would be that this is when you tried via remotes.
Is it a different / same error when you try via install.packages ?
I personally install everything via renv these days. to try that do install.packages("renv") and then
renv::install("hrbrmstr/cloc")