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

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.

Did you find a solution for that?
I am having the same issues with 'papaja' when trying to download it from github

No luck I didn't find a solution and haven't had time to delve into it further since unfortunately. Since many started getting this issue, I suspect a Windows update that started messing with paths that have accents in them.

Mh okay... damnit... I thought maybe it has something to do with my R being installed on my OneDrive shared Folder... Or with the "ö" in my path name...

That's correct, if you can install your library in another user with no special accents in their name, it should fix the issue. Otherwise, another workaround I am considering (but haven't tested yet) is to use symbolic links: https://stackoverflow.com/a/43199723/9370662

I have exactly the same Problem / Error message on my end. Should I open a new thread (just a disclaimer, already tried it on SO). Installing any GitHub package results in

remotes::install_github("rstudio/gt") Downloading GitHub repo rstudio/gt@HEAD Error: Failed to install 'gt' from GitHub: create process 'C:/R/bin/x64/Rcmd.exe' (system error 267, Der Verzeichnisname ist ungültig. ) @win/processx.c:1040 (processx_exec)

I already tried to remove any special chracters, e.g. Reinstalling R to the most simple path in C:/R/ and changing .libPaths to D:/tmp. I ve made sure I have the most recent Version of R and Rstudio. Rtools is successfully installed. Should I open a new topic? However it is really exactly the same error (e.g. system error 267, @win/processx.c:1040)

1 Like

You could try opening a new topic but what we would really need is some senior users replying to us! For the record though I will link here to your workaround: https://stackoverflow.com/a/68408378/9370662

Seems like many people are getting this issue. I don't know if it's a windows update issue or perhaps a remotes update issue.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.