The same problem is a bit vague here
I'd suggest that you start a new thread with a fairly detailed description of your working environment, for example are you working in the Posit clowd or on your own machine, OS & versions of R and Rstudio , the output of sessionInfo()
and anythiny else you can think of.
This FAQ should have some good suggestions.
Anyway, welcome to the forum.