r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
339 stars 153 forks source link

Install github from public repo #797

Closed byzheng closed 6 months ago

byzheng commented 6 months ago

When I updated to R 4.4.0 under Windows 11, I cannot install any R packages from github now with this error

Using GitHub PAT from the git credential store.
Error: Failed to install 'unknown package' from GitHub:
  HTTP error 401.
  Bad credentials

I don't think any PAT credential store locally. Any idea to fix this problem?

gaborcsardi commented 6 months ago

I don't think any PAT credential store locally.

remotes seems to think otherwise. Try to use

Sys.getenv("GITHUB_TOKEN")
Sys.getenv("GITHUB_PAT")
gitcreds::gitcreds_get()
gitcreds::gitcreds_get()$password

to see where the token is coming from, and then remove it.

byzheng commented 6 months ago

Thanks @gaborcsardi. gitcreds::gitcreds_get() finds a PAT. Where can I locate it?

byzheng commented 6 months ago

I have to remove the PAT using Windows Credential Manager.

gaborcsardi commented 6 months ago

For the record, there is also gitcreds::gitcreds_delete().