sed and expr not found and non-zero exit status when installing igraph

Hey!

I'm getting the following issue installing igraph within rstudio on Mac. I've seen something similar on Linux forums that suggest it's an issue with my PATH, but not sure how to fix it in this context.

Thanks in advance for any assistance!

install.packages("igraph")
Installing package into ‘/usr/local/lib/R/3.6/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/igraph_1.2.4.1.tar.gz'
Content type 'application/x-gzip' length 2704004 bytes (2.6 MB)
==================================================
downloaded 2.6 MB

 installing *source* package ‘igraph’ ...
 package ‘igraph’ successfully unpacked and MD5 sums checked
 using staged installation
./configure: line 473: sed: command not found
./configure: line 472: expr: command not found
./configure: line 473: sed: command not found
./configure: line 487: sed: command not found
: error: cannot create .lineno; rerun with a POSIX shell
ERROR: configuration failed for package ‘igraph’
* removing ‘/usr/local/lib/R/3.6/site-library/igraph’
sh: rm: command not found
Warning in install.packages :
  installation of package ‘igraph’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/ll/jmydhb6n7jqg5rv_c58jxkkh0000gn/T/Rtmpi1rAL3/downloaded_packages’

Have you tried updating xcode in your system?

Isn't even installed on my machine, downloading now!

Xcode v11 installed, no change to issue I'm afraid

This thread seems to be continued here: Rstudio/R can't find path for sh