简体   繁体   English

使用install_github在分支上安装软件包时出错

[英]error installing package on a branch with install_github

I've forked a package from github have made some changes. 我从github分叉了一个软件包,做了一些更改。 I'm trying to install the version of the package to which I've made changes with install_github(), but am getting an error message. 我正在尝试安装使用install_github()对其进行更改的软件包的版本,但是却收到错误消息。 Any suggestions? 有什么建议么?

The forked version: https://github.com/embruna/refnet 分叉的版本: https : //github.com/embruna/refnet

The edited version on the branch: https://github.com/embruna/refnet/tree/proposed-updates 分支上的编辑版本: https : //github.com/embruna/refnet/tree/proposed-updates

I can install the forked version with: 我可以使用以下方法安装分叉版本:

install_github("embruna/refnet", subdir="pkg")

I tried to install the version on the branch with the following: 我尝试使用以下命令在分支上安装该版本:

install_github("embruna/refnet@proposed-updates", subdir="pkg")

But then get this error: 但是然后得到这个错误:

** help
*** installing help indices
** building package indices
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
    line 1 did not have 6 elements
ERROR: installing package indices failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/refnet’
Error: Command failed (1)

Thanks for any suggestions. 感谢您的任何建议。

EDIT: There were two problems: 1) the install_github syntax I used incorrect and 2) there was a folder in "pkg" that was throwing an error even after correcting the syntax. 编辑:有两个问题:1)我使用了不正确的install_github语法,以及2)即使更正了语法,“ pkg”中仍有一个文件夹引发了错误。 See below for details. 有关详情,请参见下文。

I'm guessing that specifying the branch with @ but the subdirectory with the subdir argument is confusing devtools . 我猜想用@指定分支,但是用subdir参数指定子目录会使devtools混乱。

This works for me (specifying both subdir and branch in the repo argument): 这对我有用(在repo参数中同时指定subdir和branch):

install_github("embruna/refnet/pkg@proposed-updates",

So does this (specifying both branch and subdir as separate arguments): 这样做(将branch和subdir都指定为单独的参数):

devtools::install_github("embruna/refnet",
           ref = "proposed-updates", subdir = "pkg")

The output starts this way ... 输出以这种方式启动...

Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo embruna/refnet@proposed-updates
from URL https://api.github.com/repos/embruna/refnet/zipball/proposed-updates
Installing refnet

This is with devtools 1.12.0 这是与devtools 1.12.0一起使用的

I was able to install your proposed-updates branch with this: 我可以使用以下方法安装您的proposed-updates分支:

install_github("embruna/refnet", branch = "proposed-updates", subdir = "pkg")

I get a bunch of warnings, but no error messages. 我收到一堆警告,但没有错误消息。

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

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