2

The issue:

On one PC, Rcmd check/Rcmd build always lead with The system cannot find the path specified, and has an exit code of 1. They otherwise operate properly. However, this causes devtools::check and remotes::install_local to fail, leaving me unable to install packages from source properly and causes issues with package deployment scripts I'm using.

Even when running Rcmd check --help or Rcmd build --help, before the normal help file, I get the message The system cannot find the path specified and the exit code is 1.

What have I tried:

  • A full reinstall of R.
  • Using a different version of R.
  • Deleting HKCU\Software\R-core and HKLM\Software\R-core from the registry (I've noted that R can run properly without these, they just help RStudio/others help find R).
  • Setting R_LIBS_USER in the system environment, and removing it.

What have I found online:

I know this isn't a usual question, as I can't provide a reproducible example. I'm happy to provide any information requested (don't think version/Sys.info()/sessioninfo() provide help since this occurs with multiple R versions, and without starting R at all by just using Rcmd (but in devtools too of course)). Any suggestions are very much welcome.

Erik A
  • 31,639
  • 12
  • 42
  • 67
  • It should be `Rcmd check`: `check` is lowercase. But I think the error happens with `Rcmd`, not with `check`. Is it on your path? – user2554330 Jan 20 '22 at 12:51
  • @user2554330 Regarding the lower case, sorry, I'm actually using lowercase but somehow mistyped that in my question. Regarding the error being with Rcmd, I don't think so, Rcmd BATCH works fine. Rcmd is on my path. Also, remember that besides closing with an error code and outputting _The system cannot find the path specified_ as the first line, Rcmd build appears to be working just fine, but devtools/remotes of course error on the nonzero exit code – Erik A Jan 20 '22 at 13:16
  • Sorry, missed that. It might be that it is trying to look at a library that doesn't exist or gives permission errors. Maybe you can put together a script that will print some more diagnostics, and run it with `Rcmd BATCH`. – user2554330 Jan 20 '22 at 14:54

1 Answers1

1

I finally figured it out!

An old miniconda install, installed a long time ago through reticulate, somehow got deleted without cleaning up the relevant registry keys.

An incorrect value in the key HKEY_CURRENT_USER\Software\Microsoft\Command Processor\Autorun caused this behavior. It automatically starts scripts whenever cmd.exe starts. It pointed to a deleted conda script.

Deleting this registry key solved the issue.

Erik A
  • 31,639
  • 12
  • 42
  • 67