I'll start with my high-level goal before dropping down into what I think is wrong-- I would like to install a package using remotes::install_github(). However, when I try to do so, I get the following error:
Using github PAT from envvar GITHUB_PAT
Error: Failed to install 'unknown package' from GitHub:
HTTP error 401.
Bad credentials
Rate limit remaining: 37/60
Rate limit reset at: 2021-09-15 17:23:41 UTC
To me, that suggests that there's something wrong with the connection between RStudio and GitHub. I tried usethis::git_sitrep() to see what was going on, and get the following results
Git config (global)
• Name: 'Amelia McNamara'
• Email: 'amelia.a.mcnamara@gmail.com'
• Vaccinated: TRUE
• Default Git protocol: 'https'
GitHub
• Default GitHub host: 'https://github.com'
• Personal access token for 'https://github.com': '<discovered>'
x Token is invalid
x Can't retrieve registered email address(es)
If you are troubleshooting, check GitHub host, token, and token scopes
Git repo for current project
• Active usethis project: '/Users/amelia'
ℹ Active project is not a Git repo
However, I don't know what it means to "check GitHub host, token, and token scopes." I have tried generating a new token and adding it as a credential using gitcreds::gitcreds_set(), but that doesn't change the results from git_sitrep(). What should my next troubleshooting step be?