Search code examples
rgithubdevtools

failing to devtools::install_github() from an enterprise github account


I am trying to install an R package from an enterprise github account

devtools::install_github(
  repo = "<owner>/<repo>",
  host = "github.<org_name>.com/api/v3/",
  auth_token = <my_github_pat>
)

I get this error message Error: Failed to install '<repo>' from GitHub: HTTP error 404. Not Found Did you spell the repo owner ('<owner>') and repo name ('<repo>') correctly? - If spelling is correct, check that you have the required permissions to access the repo.

I have the correct spellings, and I think that I must have the required permissions because it's actually my repo: I can push and pull from the repo just fine. I am doing the install_github() as a test case so colleagues can install my package, but I can't make sense of this error message.


Solution

  • Literally just needed to drop the last "/" in the host string and this worked. SMH

    devtools::install_github(
      repo = "<owner>/<repo>",
      host = "github.<org_name>.com/api/v3",
      auth_token = <my_github_pat>
    )