我正在GitHub上开发两个包,我正在尝试使用 devtools::install_github()
命令安装它们 .
由于存储库是私有的,我为我的帐户创建了一个 auth_token
(据我所知,单个存储库没有办法做到这一点?)
devtools::install_github("mariodejung/rMQanalysis",
auth_token="6cd2dbe8bd1f062842b90afXXXXXXXXXXXXXXXXX",
ref="develop",
dependencies=TRUE)
devtools::install_github("mariodejung/cfpscripts",
auth_token="6cd2dbe8bd1f062842b90afXXXXXXXXXXXXXXXXX",
ref="develop")
第一个软件包的安装按预期工作,第二个软件包开始安装但因错误而停止,并且出于任何原因它提到了第一个已安装的软件包 . 请在最后的注释中查看错误 . 我不知道为什么会这样,以及如何解决它 .
我再次添加了以下错误消息,因为我已经改变了一些东西 .
很抱歉更改 auth_token
但脚本现在应保持私密状态 .
我还检查了只用一个命令安装两个包,但它导致相同的错误消息 . 我还根据评论中的建议在我的环境中添加了 GITHUB_PAT
变量,以便不公开使用身份验证令牌 .
devtools::install_github(c("mariodejung/rMQanalysis","mariodejung/cfpscripts"),
ref="develop",
dependencies=TRUE)
此命令现在成功安装 rMQanalysis
包,并在安装 cfpscripts
时失败并显示相同的错误消息 . 仍然不知道如何弄清问题是什么 . 它适用于其他机器 . 还安装了所有依赖项 .
devtools::install_github(c("mariodejung/rMQanalysis","mariodejung/cfpscripts"), ref='develop', quiet=FALSE)
Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo mariodejung/rMQanalysis@develop
from URL https://api.github.com/repos/mariodejung/rMQanalysis/zipball/develop
Installing rMQanalysis
"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/cfproteomics/AppData/Local/Temp/RtmpktvmUK/devtools43850da641a/mariodejung-rMQanalysis-0e38dd3463ea830b19f0afa2ade6f2e14db93041" \
--library="C:/Users/cfproteomics/Documents/R/win-library/3.2" --install-tests
* installing *source* package 'rMQanalysis' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
** help
No man pages found in package 'rMQanalysis'
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (rMQanalysis)
Downloading GitHub repo mariodejung/cfpscripts@develop
from URL https://api.github.com/repos/mariodejung/cfpscripts/zipball/develop
Installing cfpscripts
Downloading GitHub repo mariodejung/rMQanalysis@develop
from URL https://api.github.com/repos/mariodejung/rMQanalysis/zipball/develop
Error in stop(github_error(request)) : Not Found (404)
我也使用了 traceback()
函数,但它没有给出更多的见解......
15: stop(github_error(request))
14: download_github(dest, src, auth)
13: remote_download.github_remote(remote, quiet = quiet)
12: remote_download(remote, quiet = quiet)
11: FUN(X[[i]], ...)
10: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
9: install_remotes(object$remote[behind], ..., quiet = quiet)
8: update.package_deps(pkg, ..., Ncpus = threads, quiet = quiet,
upgrade = upgrade)
7: update(pkg, ..., Ncpus = threads, quiet = quiet, upgrade = upgrade)
6: install_deps(pkg, dependencies = initial_deps, upgrade = upgrade_dependencies,
threads = threads, force_deps = force_deps, quiet = quiet,
...)
5: install(source, ..., quiet = quiet, metadata = metadata)
4: FUN(X[[i]], ...)
3: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
2: install_remotes(remotes, quiet = quiet, ...)
1: devtools::install_github(c("mariodejung/rMQanalysis", "mariodejung/cfpscripts"),
ref = "develop", quiet = FALSE)
UPDATE2
整个问题似乎是 devtools 1.12.0
中的一个错误 . 它在 1.11.1
中工作正常 .
我想通了,我的 rMQanalysis
包在 cfpscripts
中被提及为 Imports:
. 如果我从 Description
删除此 Imports:
语句,则程序包安装正常 .
我仍然在想,为什么我不能设置 dependencies=FALSE
以防止 install_github
安装依赖包 .
我已经填写了devtools的错误报告,但还没有反应 .
2 回答
您是否尝试下载或克隆存储库[因为您已付款]并从源代码安装?
在最新的
devtools
版本中,有一些与私有GitHub存储库的安装相关的错误 . 我提出了一个issue并制作了一个PR . 你可能会发现这个问题的原因 .