Non-zero exit status RMarkdown & digest

I'm trying to knit an rmarkdown file to a HTML but I keep getting the notification to update rmarkdown and digest packages. I keep trying to update these packages but I end up getting a non-zero exit status and can't knit the file. I keep getting the same codes below:

> install.packages("digest")

  There is a binary version available but the source version is later:
       binary source needs_compilation
digest 0.6.25 0.6.26              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘digest’

trying URL 'https://cran.rstudio.com/src/contrib/digest_0.6.26.tar.gz'
Content type 'application/x-gzip' length 163988 bytes (160 KB)
==================================================
downloaded 160 KB

* installing *source* package ‘digest’ ...
** package ‘digest’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘digest’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/digest’
Warning in install.packages :
  installation of package ‘digest’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/85/gmsx9yzj2h7bfzlsmz1x_0080000gn/T/Rtmp21PMeJ/downloaded_packages’

> install.packages("rmarkdown")

  There is a binary version available but the source version is later:
          binary source needs_compilation
rmarkdown    2.3    2.4             FALSE

installing the source package ‘rmarkdown’

trying URL 'https://cran.rstudio.com/src/contrib/rmarkdown_2.4.tar.gz'
Content type 'application/x-gzip' length 3202546 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

* installing *source* package ‘rmarkdown’ ...
** package ‘rmarkdown’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘digest’
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package ‘rmarkdown’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown’
Warning in install.packages :
  installation of package ‘rmarkdown’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/85/gmsx9yzj2h7bfzlsmz1x_0080000gn/T/Rtmp21PMeJ/downloaded_packages’

The easiest solution would be to answer "no" to this question, you would get a precompiled binary version that is a little older but much easier to install.
If you need to install the latest version from source, then you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

2 Likes

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.