Atia Amin
Atia Amin

Reputation: 429

installation of package ‘rmarkdown’ had non-zero exit status - How to solve that?

I am trying to install ‘rmarkdown’ in my RStudio Version 1.4.904 and R version 4.0.3 but getting the following error. I cannot open a new rmarkdown and knit a rmarkdown file. Every time I try, this message pops up,

R Markdown documents requires an updated version of the rmarkdown package. Do you want to install this package now?

Can anyone help me with that?

install.packages(ç, dependencies=TRUE)

Installing package into ‘/Users/Library/R/4.0/library’
(as ‘lib’ is unspecified)

  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 'http://cran.utstat.utoronto.ca/src/contrib/rmarkdown_2.4.tar.gz'
Content type 'application/x-gzip' length 3202546 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

Warning in file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
dyld: lazy symbol binding failed: Symbol not found: _utimensat
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _utimensat
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 30112 Done                    echo 'tools:::.install_packages()'
     30113 Abort trap: 6           | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --no-echo --args ${args}
Warning in install.packages :
  installation of package ‘rmarkdown’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/70/lgr12kdn6wn_k36sscnc0_dw0000gn/T/Rtmpmc0jUR/downloaded_packages’```

Upvotes: 2

Views: 15191

Answers (3)

Susan
Susan

Reputation: 1

A somewhat more technical workaround but it worked for me.

  1. Go to https://cran.r-project.org/ select "Packages" from the menu on the right and navigate until you find the package you need.
  2. Download the binary.zip file for your operating system and extract the files.
  3. Copy the extracted folder into the installation directory for your packages. It should be shown somewhere in the error messages from where you attempted to install the package originally. Replace any existing files. Restart RStudio to recognize the updated versions.

Upvotes: 0

Dinesh
Dinesh

Reputation: 11

I also faced a similar problem and I spent a half-day on getting the correct solution.

Step I followed:

  1. Uninstalled the existing version

  2. Installed updated version of R - R version 4.0.4 (2021-02-15).

  3. Clicked on File->New file->R markdown. It asked to install Rmarkdown packages.

  4. Noted the packages I need to install

  5. Typed install.packages("rmarkdown", dependencies = TRUE) on R source(can be done on R console)

  6. Then I tried installing Rmarkdown packages individually and it worked for me. Below are the packages I needed to install.

    install.packages('knitr') install.packages('tinytex') install.packages('base64enc') install.packages('digest') install.packages('jsonlite') install.packages('htmltools') install.packages('rmarkdown')

Upvotes: 1

FranB
FranB

Reputation: 661

download the binary tgz (https://cran.r-project.org/web/packages/rmarkdown/index.html) and install directly from it.

It should work. I had pretty much the same issue and I solved it that way. Keep me posted! F

Upvotes: 0

Related Questions