Search code examples
rgithubdevtoolsr-packagexaringan

R Failled to install any github packages (Not curl::curl_fetch_memory issue)


I am using Windows 10 and the latest R, Rstudio, and Rtools. My R can weelinstall packages from CRAN but not from Github and get very weird message. I've looked through similar questions in Stackoverflow, github issue, and Google search and found no answers. I tried to reinstall R, Rstudio, and Rtools in different directories and different version of R and Rstudio. Nothing helps. I will appreciate if anyone can give me some help. Here is the error message I got when I tried to install xaringan:

> install_github('yihui/xaringan')
Downloading GitHub repo yihui/xaringan@master
from URL https://api.github.com/repos/yihui/xaringan/zipball/master
Installing xaringan
"C:/R-stabl/bin/x64/R" --no-site-file  \
  --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL "C:/Users/Yue  \
  Hu_local/AppData/Local/Temp/RtmpyGCl8D/devtools1c10a142590/yihui-xaringan-0453431"  \
  --library="D:/userLib" --install-tests 

* installing *source* package 'xaringan' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
  converting help for package 'xaringan'
    finding HTML links ... done
    inf_mr                                  html  
    finding level-2 HTML links ... done

    moon_reader                             html  
    summon_remark                           html  
** building package indices
** installing vignettes
** testing if installed package can be loaded
ARGUMENT 'Hu_local\AppData\Local\Temp\RtmpmA717i\Rin254c7d787958' __ignored__

Error: object 'ÿþ' not found
Execution halted
ERROR: loading failed
* removing 'D:/userLib/xaringan'
* restoring previous 'D:/userLib/xaringan'
In R CMD INSTALL
Installation failed: Command failed (1)

My Rtools is well installed:

> devtools::has_devel()
"C:/R-stabl/bin/x64/R" --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD SHLIB foo.c 

c:/Rtools/mingw_64/bin/gcc  -I"C:/R-stabl/include" -DNDEBUG          -O2 -Wall  -std=gnu99 -mtune=generic -c foo.c -o foo.o
c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o foo.dll tmp.def foo.o -LC:/R-stabl/bin/x64 -lR
[1] TRUE

And here's my system information:

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

loaded via a namespace (and not attached):
[1] compiler_3.4.3  withr_2.1.1     memoise_1.1.0   digest_0.6.14  
[5] devtools_1.13.4

Solution

  • The solution of this issue is found here: It turns out being a problem of temp direction, which is probably unique for Windows. After I redirected the temp to a new direction with no space in it (in .Renviron), the problem disappeared.