简体   繁体   中英

R devtools:install_github() - what does “Error: JSON: EXPECTED value GOT <” mean?

I'm trying to install an R package from GitHub using devtools (as I've done many times before), however I get the following error:

devtools::install_github("rickhelmus/patRoon")
Error: JSON: EXPECTED value GOT <
In addition: Warning message:
In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.

It doesn't depend on the package I want to install, same error for different packages.

What does this error mean? and how can I fix it?

I'm using R Studio Version 1.1.463 and R 3.4.4.

Thanks! Andrea

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

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

other attached packages:
[1] httr_1.3.1     usethis_1.4.0  devtools_2.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0        rstudioapi_0.8    magrittr_1.5      pkgload_1.0.2     R6_2.3.0          rlang_0.3.0.1     tools_3.4.4      
 [8] pkgbuild_1.0.2    sessioninfo_1.1.1 cli_1.0.1         withr_2.1.2       remotes_2.0.2     yaml_2.1.19       assertthat_0.2.0 
[15] digest_0.6.18     rprojroot_1.3-2   crayon_1.3.4      processx_3.2.0    callr_3.0.0       base64enc_0.1-3   fs_1.2.6         
[22] ps_1.2.1          curl_3.2          testthat_2.0.1    glue_1.3.0        memoise_1.1.0     compiler_3.4.4    desc_1.2.0       
[29] backports_1.1.2   prettyunits_1.0.2

NOT AN ANSWER JUST TRIAGE HELP

As noted in the comment thread, this looks like you're getting an HTML pae and that is indicative of there being an intermediary (like a proxy server) between you and the destination and the proxy has no idea how to process the request (perhaps due to no authentication). I'm still not sure why that would impact you at home (unless you're on the VPN or your workplace maintains proxy server settings when at home for some reason).

Can you run this (which is what install_github() ultimately does):

res <- httr::GET("https://github.com/rickhelmus/patRoon/archive/master.zip")

and if you don't get something like this when printing res :

res
## Response [https://codeload.github.com/rickhelmus/patRoon/zip/master]
##   Date: 2018-12-05 14:11
##   Status: 200
##   Content-Type: application/zip
##   Size: 10.5 MB
## <BINARY BODY>

Can you post what you do get when you print res to a code block in your question?

Then I can post some follow up triage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM