I am trying to build a package and the package generation fails with the error:
Warning: running command '"zip" -r9Xq "C:/path/package_name_version.zip"
SEERtools' had status 127 running 'zip' failed
The package is built successfully, but the binary is missing.
Build log:
> devtools::build(binary = TRUE,path=".")
"C:/Rpath/R-32~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore CMD INSTALL \
"C:\path" --build
* installing to library 'C:/Libpath/library'
* installing *source* package 'package_name' ...
** R
** data
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* MD5 sums
Warning: running command '"zip" -r9Xq "C:/path/package_name_version.zip" package_name' had status 127
running 'zip' failed
* DONE (package_name)
[1] "./package_name_version.zip"
The error message doesn't give a clue where to look. I tried:
The problem is not the same as Create zip file: error running command " " had status 127 since there the problem lies in the zip procedure. In this case the zip function still behaves as expected (separately), but the specific zip command in the build function fails.
The best answer I found was adding '--preclean' to the build arguments.
>devtools::build(binary = TRUE,path=".", args = c('--preclean'))
According to the documentation this only cleans the files from a previous build, but it does solve the error message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With