Error in unserialize(socklist[[n]]) : error reading from connection

Check Repository for distributing (some) stan-dev R packages | r-packages

and try

install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

I had an old version of rstan (version 2.21.2 from CRAN), and It was showing the error.
A new version, rstan version 2.26.3 (Stan version 2.26.1), doesn’t show the error.

1 Like