R Markdown won't knit even though my code chunks work

Do you use install.packages() in your .Rmd file? You shouldn't do that. Install any required packages first, then knit the document without any calls to install.packages().