15

I have a shiny program in R that works great. But I am having trouble deploying it to shinyapps.io.

The javascript error console gives me the following error:

Listening on http://127.0.0.1:46574
  Downloading github repo jlisic/saAlloc@master
  Installing saAlloc
  '/usr/lib/R/bin/R' --vanilla CMD INSTALL  \
  '/tmp/RtmpvmoFM3/devtools2c6b564aad/jlisic-saAlloc-62692fc'  \
  --library='/usr/local/lib/R/site-library' --install-tests 

Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’
Error : Command failed (1)

There is nothing fancy about my package it just has a default Makevars file. Any help or suggestions would be appreciated.

3

1 Answer 1

12

I have also been struggling with this issue, and I just found a working answer in the shinyapps.io Google users group by @Yihui. Quoting his post:

You should not install the package inside your app (i.e. do not call install_github() in your app code). Just install it locally, and shinyapps.io will figure out how to install it on the server.

https://groups.google.com/d/msg/shinyapps-users/5S8jTJ-SeHM/HCPGUjYVUM4J

Removing the devtools::install_github() line in server.R worked for me. Back end magic!

EDIT: The reason why this works is explained in more detail in this rsconnect issue: https://github.com/rstudio/rsconnect/issues/88

1
  • 1
    I want to add that installing a local clone of the package with R CMD INSTALL did not work for me. I really had to install my own package with remotes::install_github() for the shinyapps.io deployment
    – nevrome
    Commented Mar 31, 2020 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.