I ran into this problem when trying to install a really old version of plotly with pkg_vload(plotly("4.7.1")). There was some error during the installation due to an unavailable dependency. Afterwards, runnign the command again said something like "package plotly doesn't exist".
Despite the failed installation, there was a leftover folder in the user library. Deleting it solved the problem. I need to make sure to clean-up in case of error.