Missing devtools in RStudio 4.0.2 after downloading RTools 40 and RTools43

I am using an AI model from RStudio (GitHub - herdiantrisufriyana/colab_dep).

Install devtools to install specific version of BiocManager.

if(!require(devtools)) install.packages('devtools')

When this runs I get the issue:

Loading required package: devtools
Warning: there is no package called ‘devtools’
...

  • installing to library 'C:/Users/alfie/OneDrive/Documents/colab_dep-main/renv/staging/1'
  • installing source package 'curl' ...
    ** package 'curl' successfully unpacked and MD5 sums checked
    ** using staged installation
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config CC' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config CFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config CXX' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config CXXFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config CPPFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config LDFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config FC' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config FCFLAGS' had status 1
    Error in (function (...) : 'names' and 'val' are of different lengths
  • removing 'C:/Users/alfie/OneDrive/Documents/colab_dep-main/renv/staging/1/curl'
    Error: install of package 'curl' failed [error code 1]

I have installed devtools manually to fix another issue. I have installed curl manually which hasn't fixed the issue.

After seeing a similar post I tried to change the options:
Package management screenshot

Any help is appreciated.

You need RTools44 for R 4.4.x, see RTools: Toolchains for building R and R packages from source on Windows

From your output, is seems like that's what you are using:

running command '"C:/PROGRA~1/R/R-44~1.2/bin/x64/Rcmd.exe" config CXX' had status 1

RStudio version numbers look like YEAR.MONTH.NUM, e..g. the latest one is 2024.12.0, see e.g. RStudio IDE / Workbench - Supported Versions – Posit Docs

If you still have an issue, please post the output of the sessionInfo() command.