The new message on this thread motivated me to explore the issue.
-
Things were failing because the PAT bundled in devtools was not valid anymore Error using `install_github()`: HTTP error 401. Bad credentials. · Issue #641 · r-lib/remotes · GitHub
-
However, it has always been recommended to use one's own PAT anyway cf comment by @jimhester Error using `install_github()`: HTTP error 401. Bad credentials. · Issue #641 · r-lib/remotes · GitHub
Using the PAT is only to increase the rate limits. The default rate limit for unauthenticated requests is only 60 per hour, and remotes needs to do a API request for all packages being installed, to verify their versions and see if they need to be updated.
You can do it without the PAT but you may then find you are running into rate limits often.
All r-lib examples have the correct lines.