install_github(): "system error 267, The directory name is invalid"

I am trying to install package performance development version with devtools but am getting this error:

> devtools::install_github("easystats/performance")
Downloading GitHub repo easystats/performance@HEAD
Error: Failed to install 'performance' from GitHub:
  create process 'C:/PROGRA~1/R/R-40~1.3/bin/x64/Rcmd.exe' (system error 267, The directory name is invalid.
) @win/processx.c:1040 (processx_exec)

Same thing with alternative remotes command:

> remotes::install_github("easystats/performance")
Downloading GitHub repo easystats/performance@HEAD
Error: Failed to install 'performance' from GitHub:
  create process 'C:/PROGRA~1/R/R-40~1.3/bin/x64/Rcmd.exe' (system error 267, The directory name is invalid.
) @win/processx.c:1040 (processx_exec)

Edit: Note that I am getting the same error no matter what package I've tried to install through devtools (e.g., cardiomoon/processR or r-lib/crayon). This started to happen suddenly a few weeks ago yet never had this issue before. So it seems not related to the package but to something else.

So I tried changing my default library to the simplest ever location that doesn't have any special characters or require any admin rights, with those instructions. I can confirm that C:/Rpackages is now indeed my default library path, and that it is first (on the left):

> .libPaths()
[1] "C:/Rpackages"                      "C:/Program Files/R/R-4.0.3/library"

However, I am still getting the same error. The weird thing is that the error still seems to refer to the second library path rather than the first one, which seems off to me. From the help documentation, I don't see how to specify the library location explicitly for neither devtools nor remotes. Also interesting, notice that the error seems to mention R-40~1.3 instead of R-4.0.3 as it should(?). Might this be the issue? Then how to fix?

I also tried reinstalling devtools and remotes, to no avail.

Yet, it works if I install the regular CRAN version:

> install.packages("performance")
Installing package into ‘C:/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/performance_0.7.2.zip'
Content type 'application/zip' length 2487172 bytes (2.4 MB)
downloaded 2.4 MB

package ‘performance’ successfully unpacked and MD5 sums checked

Here my session info if useful:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252   
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C                   
[5] LC_TIME=English_Canada.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3 tools_4.0.3    yaml_2.2.1    

Original post: r - install_github(): "system error 267, The directory name is invalid" - Stack Overflow

I've got the same error with one of my students.
No idea what to do.

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

I ended up reinstalling Rtools, R, and Rstudio, and still experiencing this error. So at this point I wonder if it is not more of a Windows problem (e.g., with Environment variables?). Hopefully, someone from the R Studio community will be able to shed some light on this.

@Juvenal_Campos I believe your student answered on the original stackoverflow post this morning saying he had the same issue but unfortunately his post was deleted so I am not able to reach out to him regarding my troubleshooting. Is it possible to ask him to contact me?

Regardless, I have some update suggesting it seems to relate to Windows (maybe a new update broke some things?). See my new post about this:

I'd be curious to see if your student experiences the same issue with Windows Explorer.