library not found in browser but in Rstudio

Hi, I'm facing a stranger error...
In Rstudio when I launch my app, all is fine and the Shiny App looks good.
But when I try to launch it in my browser I have an error in the log :

Error in library(shinyjs) : there is no package called ‘shinyjs’

But the shinyjs is present in the library path :

/home/admin/R/x86_64-pc-linux-gnu-library/3.2

When I print the library path (.libPaths()) in the app while launching it with Rstudio I have the same path :

/home/admin/R/x86_64-pc-linux-gnu-library/3.2

I tried to install the shinyjs package again :

> install.packages('shinyjs')
Installing package into ‘/home/admin/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
--- SVP sélectionner un miroir CRAN pour cette session ---
essai de l'URL 'https://cran.irsn.fr/src/contrib/shinyjs_2.1.0.tar.gz'
Content type 'application/x-gzip' length 1019936 bytes (996 KB)
==================================================
downloaded 996 KB

* installing *source* package ‘shinyjs’ ...
** package ‘shinyjs’ correctement décompressé et sommes MD5 vérifiées
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (shinyjs)

But I have still the same error !
Any clue ???
Thanx

Are you deploying to shiny-server?

Yes my app is in the/srv/shiny-server directory with other apps whose working fine.
I'm thinking about something, maybe there's a rights issue with the shinyjs directory owner ? I have to check it tomorrow in front of my PC

Shiny server runs as the shiny user, so, packages need to be installed system wide in order for shiny to be able to use them. A way of doing this is to install packages from a system terminal with sudo e. g.

sudo su - -c "R -e \"install.packages('shinyjs', repos='http://cran.rstudio.com/')\""

Thanks ! Packages weren't installed in the right place...

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.