Installing my R package via install_git fails

My company has it's own private gitlab repo. I have an R package - Package A - which has one dependency - Rcpp. I have created a new package - Package B - which Imports Package A.

I can install Package A and then B locally via RStudio. By default I use the following install arguments --preclean --no-multiarch --with-keep.source. But it works without them as long as I am consistent about the the architecture option.

I can install package A but not B from the remote using devtools::install_git. I've tried the following

# First with options that match local  ------------------------------------


# installs
devtools::install_git(
  url = 'https://gitlab.companyurl/packageA',
  credentials = git2r::cred_user_pass(
    "username", 
    getPass::getPass()
  ),
  INSTALL_opts=c(
    "--preclean", "--no-multiarch", 
    "--with-keep.source"
  )      
)

# fails
# Error: Failed to install 'unknown package' from Git:
#   Error in 'git2r_remote_ls'
# Error in validate_signal_args(msg, type, call) : unused argument (call)

devtools::install_git(
  url = 'https://gitlab.companyurl/packageB',
  credentials = git2r::cred_user_pass(
    "username", 
    getPass::getPass()
  ),
  INSTALL_opts=c(
    "--preclean", "--no-multiarch", 
    "--with-keep.source"
  )                      
)
# Now vanilla -------------------------------------------------------------

# installs
devtools::install_git(
  url = 'https://gitlab.companyurl/packageA',                      
  credentials = git2r::cred_user_pass(
    "username", 
    getPass::getPass()
  )                      
)

# fails
# Error: Failed to install 'unknown package' from Git:
#   Error in 'git2r_remote_ls'

devtools::install_git(
  url = 'https://gitlab.companyurl/packageB',
  credentials = git2r::cred_user_pass(
    "username", 
    getPass::getPass()
  )                      
)
# Now installing Package A via RStudio ---------------------------------------------------------

# If Install Package A locally using the 
# options --preclean --no-multiarch --with-keep.source

# And then install Package B from the remote using these options, it works!
devtools::install_git(
  url = 'https://gitlab.companyurl/packageB',
  credentials = git2r::cred_user_pass(
    "username", 
    getPass::getPass()
  ),
  INSTALL_opts=c(
    "--preclean", "--no-multiarch", 
    "--with-keep.source"
  )                      
)

Any idea why the first 2 examples work locally via RStudio but not when I try and install from the remote ?

Equally why does the 3rd option work, shouldn't the installation for package A be the same in the 3rd example as the first given I've specified the same install arguments ?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum