-1

I've been trying to install packages on Rstudio however I keep getting this error message:

sh: tar: command not found Warning in install.packages : error in running command Warning in install.packages : 'tar' returned non-zero exit code 127 Error in install.packages : file ‘/var/folders/8f/pzz7gpkd4xx_8mcggmk6t40w0000gn/T//RtmpwSJHG5/downloaded_packages/webshot_0.5.5.tgz’ is not a macOS binary package

Is there a way to fix this?

I've tried googling for solutions but have not seen any.

jpsmith
  • 11,023
  • 5
  • 15
  • 36
SetshabaT
  • 1
  • 1
  • Hi SetshabaT! Can you please add the command you executed that resulted in this error? – Andre Wildberg Aug 18 '23 at 14:08
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 18 '23 at 21:37
  • Hi Andre, I was trying to install webshot so I used: install.packages('webshot') – SetshabaT Aug 19 '23 at 09:56
  • It’s an uncommon error in that sense that it includes a shell reference and a complaint about the binary. You can always try to download the arm64 binary https://cran.r-project.org/web/packages/webshot/index.html and install manually https://stackoverflow.com/questions/14806705/manually-downloading-and-installing-packages-in-r though. – Andre Wildberg Aug 19 '23 at 11:59

1 Answers1

0

You need to make sure that the 'tar' command is available on your system. Since you're using macOS, 'tar' should already be present by default. However, sometimes issues can arise due to misconfigurations or other factors.

Here's what you can try:

Check if 'tar' is Installed: Open your terminal and type the following command to check if 'tar' is installed on your system:

tar --version

If the 'tar' command is not found or if you get an error message, it means 'tar' is not installed or not configured correctly.

Install or Reinstall 'tar':

brew install tar
Jasmine H
  • 1
  • 1
  • I tried checking if its installed and I got this (bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8). I then reinstalled however I still get the same error message on R – SetshabaT Aug 19 '23 at 10:18