I am developing an R package, which during development, I am distributing among colleagues with tarballs. Some of them are unable to install the package because of such an error:
> install.packages("~/Desktop/package.tar.gz", repos = NULL, type = "source")
* installing *source* package ‘package’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
No man pages found in package ‘package’
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
ERROR: hard-coded installation path: please report to the package maintainer and use ‘--no-staged-install’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/package’
Warning in install.packages :
installation of package ‘/Users/name/Desktop/package.tar.gz’ had non-zero exit status
The error tells us, that installation fails because of the hard-coded installation path. The thing is that I don't have installation path coded anywhere in the package (I use system.path() couple of times).
I am able to do the installation by running the command R CMD INSTALL package.tar.gz --no-staged-install all but this is not the desired installation method.