RStudio cannot find make: 'make' is not recognized as an internal or external command, operable program or batch file.

I am a makefile newbie but would like to try them out. I have installed Rstudio, Rtools, and Gnu Make 3.2 but when I try to test a simple makefile in RStudio I get the following error message:

image

(It says "'make' is not recognized as an internal or external command, operable program or batch file. \n\nExited with status 1.")

I suspect this might be a PATH issue; there is no reference to Gnu make there but as I said, I rarely dig into the guts of R and never with make. So can anyone advise?

Thanks in advance!

JM

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. It's not needed for this question, but keep in mind for coding questions.

An error message like this nearly always means that either the program hasn't been installed, has been installed under a different name or, most often, it is not findable because it is not in the path of directories searched.

As it appears that the system is running under Windows, I can't help further, since it's been 15 years since I've worked in that environment

If you're using Windows, you'll need to install Rtools:

https://cran.r-project.org/bin/windows/Rtools/

And you'll want to also ensure that the Rtools bin directory is on the PATH; e.g.

path <- Sys.getenv("PATH")
path <- paste("C:\\Rtools\\bin", path, sep = ";")
Sys.setenv(PATH = path)

You might want to put that in your .Rprofile or similar to make sure Rtools is always on the PATH.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.