rshinyshinyappshtmltools

How to avoid Error in load Namespace using R


Am trying to launch a shiny app using the below command.

Rscript -e "shiny::runApp('test-app', launch.browser=TRUE)"

However, I get an error as shown below

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  namespace 'htmltools' 0.4.0 is being loaded, but >= 0.4.0.9003 is required
Calls: :: ... getNamespace -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted

I did check my library folder and see that htmltools package is present.

I also tried the below dependencies=TRUE

install.packages(pkgs,lib = "C:/Users/User/Desktop/data/library",repo = "https://cloud.r-project.org",dependencies=TRUE)

Here pkgs is a list containing list of packages that has to be installed.

The problem is same script works in my system but it doesn't work in my colleague's system. How can I resolve this?

Can help me understand what's the issue?


Solution

  • Although Kouadio has the correct answer, I found it difficult to follow those brief instructions, so I'm making them more detailed here.

    1. Quit RStudio.
    2. Find the RStudio launch icon, either on your desktop or in your Windows Start Menu.
    3. Right-click the icon and choose "Run as administrator." Say yes when prompted that this is really what you want to do.
    4. In RStudio, go to the Tools menu and choose Check for Updates.
    5. Select all the packages and choose to update them. Say yes to the relevant prompts.

    You should then be able to use the Knit button again, but you probably want to quit RStudio and restart in non-administrative mode before doing so.