Cannnot Knit R Markdown

I am not able to knit my markdown. When I try to, I get this Error:

Line 9 Error in contrib.url(repos, "source") : trying to use CRAN without 
setting a mirror Calls: <Anonymous> ... with Visible -> eval -> 
install.packages -> contrib.url Execution halted

Currently, all I have in my markdown is:

8   ```{r import data}
9   install.packages("readxl")
10  library(readxl)
11  passengers <- read_excel("titanic.xlsx")
12  ```

Thank you,
Anisha