If you have R 4.0.0 or later and use Windows or Mac, you can directly install the StanMoMo binary package via
repos<-c("https://cloud.r-project.org","https://kabarigou.github.io/drat")
install.packages("StanMoMo",repos=repos,type = "binary")