在 Symfony 4/5 中安装 orm-fixtures 时 Composer 发生冲突

Red*_*aha 3 php symfony doctrine-orm composer-php

当我尝试orm-fixtures在 Symfony 5.1 中安装时遇到问题:

$ composer require orm-fixtures --dev
Using version ^3.3 for doctrine/doctrine-fixtures-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install doctrine/doctrine-fixtures-bundle 3.3.1
    - Conclusion: remove doctrine/cache 1.10.2
    - Conclusion: don't install doctrine/cache 1.10.2
    - doctrine/common 2.2.1 conflicts with doctrine/cache[1.10.2].
    - doctrine/common 2.2.2 conflicts with doctrine/cache[1.10.2].
    - doctrine/common 2.2.3 conflicts with doctrine/cache[1.10.2].
    - doctrine/common 2.3.0 conflicts with doctrine/cache[1.10.2].
    - Conclusion: don't install doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2.2.2|install doctrine/common 2.2.3|install doctrine/co
mmon 2.3.0
    - Conclusion: don't install doctrine/doctrine-fixtures-bundle 3.3.1|remove doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2.2.2|in
stall doctrine/common 2.2.3|install doctrine/common 2.3.0
    - Conclusion: don't install doctrine/doctrine-fixtures-bundle 3.3.1|don't install doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2
.2.2|install doctrine/common 2.2.3|install doctrine/common 2.3.0
    - Installation request for doctrine/cache (locked at 1.10.2) -> satisfiable by doctrine/cache[1.10.2].
    - Conclusion: don't install doctrine/doctrine-fixtures-bundle 3.3.1|remove doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2.2.2|in
stall doctrine/common 2.2.3|install doctrine/common 2.3.0
    - Conclusion: don't install doctrine/doctrine-fixtures-bundle 3.3.1|don't install doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2
.2.2|install doctrine/common 2.2.3|install doctrine/common 2.3.0
    - Installation request for doctrine/doctrine-fixtures-bundle ^3.3 -> satisfiable by doctrine/doctrine-fixtures-bundle[3.3.0, 3.3.1].
    - Conclusion: remove doctrine/common 3.0.2|install doctrine/common 2.2.1|install doctrine/common 2.2.2|install doctrine/common 2.2.3|install doctrine/common 2.
3.0
    - doctrine/doctrine-fixtures-bundle 3.3.0 requires doctrine/data-fixtures ^1.3 -> satisfiable by doctrine/data-fixtures[1.3.3, 1.4.0, 1.4.1, 1.4.2, 1.4.3, v1.3
.0, v1.3.1, v1.3.2].
    - doctrine/data-fixtures 1.3.3 requires doctrine/common ~2.2 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, 2.2.0, 2.2.1, 2.2.2, 2.2
.3, 2.3.0, v2.10.0, v2.11.0, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.5.0, v2.5.1, v2.5.2, v2.5.3, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.8.0, v2.8.1
, v2.9.0].
    - doctrine/data-fixtures 1.4.0 requires doctrine/common ^2.11 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, v2.11.0].
    - doctrine/data-fixtures 1.4.1 requires doctrine/common ^2.11 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, v2.11.0].
    - doctrine/data-fixtures 1.4.2 requires doctrine/common ^2.11 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, v2.11.0].
    - doctrine/data-fixtures 1.4.3 requires doctrine/common ^2.11 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, v2.11.0].
    - doctrine/data-fixtures v1.3.0 requires doctrine/common ~2.2 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, 2.2.0, 2.2.1, 2.2.2, 2.
2.3, 2.3.0, v2.10.0, v2.11.0, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.5.0, v2.5.1, v2.5.2, v2.5.3, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.8.0, v2.8.
1, v2.9.0].
    - doctrine/data-fixtures v1.3.1 requires doctrine/common ~2.2 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, 2.2.0, 2.2.1, 2.2.2, 2.
2.3, 2.3.0, v2.10.0, v2.11.0, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.5.0, v2.5.1, v2.5.2, v2.5.3, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.8.0, v2.8.
1, v2.9.0].
    - doctrine/data-fixtures v1.3.2 requires doctrine/common ~2.2 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, 2.2.0, 2.2.1, 2.2.2, 2.
2.3, 2.3.0, v2.10.0, v2.11.0, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.5.0, v2.5.1, v2.5.2, v2.5.3, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.8.0, v2.8.
1, v2.9.0].
    - Can only install one of: doctrine/common[2.12.0, 3.0.2].
    - Can only install one of: doctrine/common[2.13.0, 3.0.2].
    - Can only install one of: doctrine/common[2.13.1, 3.0.2].
    - Can only install one of: doctrine/common[2.13.2, 3.0.2].
    - Can only install one of: doctrine/common[2.13.3, 3.0.2].
    - Can only install one of: doctrine/common[v2.11.0, 3.0.2].
    - Can only install one of: doctrine/common[2.2.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.10.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.4.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.4.1, 3.0.2].
    - Can only install one of: doctrine/common[v2.4.2, 3.0.2].
    - Can only install one of: doctrine/common[v2.4.3, 3.0.2].
    - Can only install one of: doctrine/common[v2.5.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.5.1, 3.0.2].
    - Can only install one of: doctrine/common[v2.5.2, 3.0.2].
    - Can only install one of: doctrine/common[v2.5.3, 3.0.2].
    - Can only install one of: doctrine/common[v2.6.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.6.1, 3.0.2].
    - Can only install one of: doctrine/common[v2.6.2, 3.0.2].
    - Can only install one of: doctrine/common[v2.7.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.7.1, 3.0.2].
    - Can only install one of: doctrine/common[v2.7.2, 3.0.2].
    - Can only install one of: doctrine/common[v2.7.3, 3.0.2].
    - Can only install one of: doctrine/common[v2.8.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.8.1, 3.0.2].
    - Can only install one of: doctrine/common[v2.9.0, 3.0.2].
    - Installation request for doctrine/common (locked at 3.0.2) -> satisfiable by doctrine/common[3.0.2].


Installation failed, reverting ./composer.json to its original content.
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误。

我知道这个问题来自我的库版本,但我不知道如何解决它我今天才启动 Symfony。

Cer*_*rad 8

更新:确认截至 2020 年 9 月 1 日,问题已解决。固定装置现在可以干净地加载,无需任何调整。那些使用过这个程序的人可能想要从冲突部分中删除教义行,然后再做一次 Composer 更新,只是为了恢复同步。

要重现该问题,请从一个新的 5.1 项目开始并尝试安装设备包:

symfony new --full new_project
cd new_project
composer require --dev orm-fixtures
Run Code Online (Sandbox Code Playgroud)

你会收到很长很长的错误信息。这是权力正在努力的事情。实际上,这种问题在各种测试过程中都被忽略了,这有点奇怪。非常稀有。

但是,您可以通过进行一些教义降级来解决它。将这些原则行添加到 composer.json:

    "conflict": {
        "symfony/symfony": "*",
        "doctrine/common": ">= 3.0",
        "doctrine/persistence": "<1.3"
    },
Run Code Online (Sandbox Code Playgroud)

然后,秘密成分,您应该清除作曲家缓存并进行作曲家更新以实际降级教义:

composer clear-cache
composer update
composer require --dev orm-fixtures
Run Code Online (Sandbox Code Playgroud)

它应该工作。

但同样,这一切都有望在不久的将来得到解决。