如何解决作曲家的最低稳定性

how to solve composer minimum-stability

我正在尝试安装 Symfony CMF 包。

我已经安装了 SonataAdminBundle 3.x,它需要 SonataBlockBundle 3.x

安装 SymfonyCMF 捆绑包时需要 symfoy-cmf/block-bundle 1.x,但此块捆绑包需要 SonataBlockBundle 2.5 或更少。

我已经 fork symfoy-cmf/block-bundle 1.x 并将要求更改为 3.1 或更低版本。

但我仍然遇到以下错误

Problem 1
    - symfony-cmf/block-bundle 1.3.0 requires sonata-project/block-bundle >=2.2.12,<2.5 -> satisfiable by

sonata-project/block-bundle[2.2.12, 2.2.13, 2.2.14, 2.2.15, 2.3.0, 2.3.1, 2.3.10, 2.3.11, 2.3.12, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9] but these conflict with your requirements or minimum-stability. - symfony-cmf/symfony-cmf 1.3.0 requires symfony-cmf/block-bundle 1.3.* -> satisfiable by symfony-cmf/block-bundle[1.3.0]. - Installation request for symfony-cmf/symfony-cmf ~1.3 -> satisfiable by symfony-cmf/symfony-cmf[1.3.0].

composar.json

    ...
    "symfony-cmf/symfony-cmf":              "~1.3",
    "iBasit/block-bundle":                  "dev-master", // this is to replace sonata-cmf/block-bundle requirement
    "sonata-project/block-bundle":          "3.0.*",
    ...

我们遇到了作曲家依赖冲突。

我尝试了一些方法

  • 使用最小稳定性部分
  • 使用冲突部分
  • 先安装 cmf,然后再安装管理包
  • 检查您尝试过的方式

关于你的问题,我已经做了我所知道的一切,但我没有看到任何正确的决定。

这里最好的方法是使用最小稳定性部分来 cmf 捆绑 "prefer-stable": true 标志

我强烈不建议您进行一些更改,例如 "I have fork the symfoy-cmf/block-bundle 1.x and change the requirement to 3.1 or less",因为将来它可能会破坏包的依赖性和逻辑,并且是硬编码。

感谢关注,如果有人找到问题的答案,请告诉我。