简体   繁体   English

R devtools:install_github()-“错误:JSON:预期值GOT <”是什么意思?

[英]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从GitHub安装R包(就像我之前做过很多次一样),但是出现以下错误:

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. 我正在使用R Studio版本1.1.463和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 没有答案的Triage帮助

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). 如注释线程中所述,这看起来像您正在获取HTML pae,这表明您与目的地之间存在中介(例如代理服务器),并且代理不知道如何处理请求(也许由于没有身份验证)。 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). 我仍然不确定为什么这会影响您在家(除非您使用VPN或工作场所出于某种原因在家中维护代理服务器设置)。

Can you run this (which is what install_github() ultimately does): 您可以运行此命令(这是install_github()最终执行的操作):

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

and if you don't get something like this when printing res : 并且如果在打印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? 当您在问题中的代码块上打印res时,您可以发布您得到的结果吗?

Then I can post some follow up triage. 然后,我可以发布一些后续分类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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