Error in install.packages : is not a macOS binary package >

Getting this error on all package installation attempts
sh: tar: command not found
Warning in install.packages :
error in running command
Warning in install.packages :
'tar' returned non-zero exit code 127

Your Mac does not have XCode and its command line utilities installed. Try again but this time answer “No” when offered the later source code version

I was having a similar problem. It wasn't about Xcode command line utilities. (tar almost certainly doesn't depend on that.)

In my case it is a typo in my $HOME/.Rprofile which contains a line

Sys.setenv(PATH="/opt/local/bin:usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/TeX/texbin")

Where I have :usr/bin: I should have :/usr/bin

There are other things about my .Rprofile that suggests that I copy/pasted much of it from somewhere at some point. So it is possible that the typo exists in what I, and perhaps others, copied.

1 Like