繁体   English   中英

R 在安装包依赖项时不考虑最大版本

[英]R doesn't respect maximum version when installing package dependencies

假设我正在开发一个名为magicr的包来做一些统计魔术,我希望它使用另一个名为fairydust的包中的函数,该包(假设)存在于 CRAN 上。

不幸的是fairydust刚刚向 CRAN 发布了 2.0.0 版本,完全破坏了我计划使用的功能。

所以我更新了我的描述

Imports:
     fairydust (<= 1.9.9)

并构建包并尝试将测试安装到干净的库中

devtools::install_local("~path/to/magicr")

Installing magicr
Installing 1 package: fairydust
Installing package into /path/to/current/library/fairydust
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/fairydust_2.0.0.zip'
Content type 'application/zip' length 11235813 bytes (11.2 MB)
downloaded 11.2 MB

package ‘fairydust’ successfully unpacked and MD5 sums checked

* installing *source* package 'magicr' ...
** R
** inst
** tests
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace 'fairydust' 2.0.0 is being loaded, but <= 1.9.9 is required
ERROR: lazy loading failed for package 'magicr'
* removing 'path/to/current/library/magicr'
Error: Command failed (1)

因此,在解决依赖关系时,它只是从 CRAN 安装了最新版本的fairydust ,然后在尝试加载magicr时检查版本。

有没有办法在安装magicr时自动获取所需版本的fairydust ,而无需构建并指向自定义存储库(la dratminiCRAN )。

我知道这是超级旧的,但因为这是我搜索中的热门:R 显然不尊重最大版本,只是 >=

来源

暂无
暂无

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

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