Deployed learnr tutorial gives package not available error


I have a tutorial that runs locally and uses only the learnr and tidyverse packages (and loads these packages properly in the source code). When I deploy to or to RStudio Connect I get an error that says the tidyverse package is not available.

In the tutorial I have a mix of exercise code that works as is as well as some broken exercise code (for learners to fix up before they run the exercise).

Below is the warning I get in the Deploy logs:

Warning message:
In fileDependencies.R(tempfile) :
  Failed to parse /var/folders/k2/mcnrccp9601c_qwvws0vh25w0000gn/T//RtmpLurP9Z/filed5ac75b4934c ; dependencies in this file will not be discovered.

Any input as to how to deploy the tutorial would be much appreciated.

1 Like

The issue is triggered by the existence of broken code in the exercises in the tutorial. The current CRAN version of the packrat package, which gets used in the background when determining the dependencies of the tutorial to be deployed, will not find all of your dependencies to install when the tutorial contains broken code.

However the development version of the packrat package is able to find dependencies per R chunk, allowing for broken R chunks within the tutorial file. Install this version from GitHub with the following


and then try redeploying the tutorial.

See the note on the learnr site about this as well:


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