'Error when using eval(x) inside library where x is a string

I am trying to understand tidyeval. Why does the below error occur?

x <- "dplyr"
library(eval(x))
## Error in library(eval(x)) : 'package' must be of length 1



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source