remotes::install_github() throws error where pak::pak() works for private repo

I came across this issue when I wanted to renv::restore() an older project of mine: One package, hosted as a private repo on my organisations GitHub-page (I have admin access), failed to install.
I then tried to install it with remotes::install_github("orga/package") which failed with the following error (I re-created the error now with a private package on my own account):

Error: Failed to install 'unknown package' from GitHub:
  HTTP error 404.
  Not Found

  Did you spell the repo owner (`cathblatter`) and repo name (`cblttrp`) correctly?
  - If spelling is correct, check that you have the required permissions to access the repo.

Interestingly, with pak::pak("orga/package") it installs correctly.

I am confused as to why this happens - has anyone an idea?

R version 4.2.0 (2022-04-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.3.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.2.0    cli_3.2.0         tools_4.2.0       rstudioapi_0.13  
 [5] curl_4.3.2        remotes_2.4.2     crayon_1.5.1      renv_0.15.4      
 [9] pak_0.3.0         tcltk_4.2.0       sessioninfo_1.2.2

this is answered here: `renv::restore()`fails with private repo (hosted on github-organization site) · Issue #996 · rstudio/renv · GitHub

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.