'symfony / dom-crawler'和Symfony 2.8的依赖问题

时间:2018-12-12 08:22:48

标签: composer-php symfony-2.8

我无法在本地环境上成功运行composer install。我每次都会收到此错误:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install symfony/symfony v2.8.49
    - Conclusion: don't install symfony/symfony v2.8.48
    [ ... Continues for each symfony/symfony version]
    - Conclusion: don't install symfony/symfony v2.8.1
    - don't install symfony/dom-crawler v2.3.0|don't install symfony/symfony v2.8.0
    - don't install symfony/dom-crawler v2.3.1|don't install symfony/symfony v2.8.0
    [ ... Continues for each symfony/dom-crawler version]
    - don't install symfony/dom-crawler v2.3.9|don't install symfony/symfony v2.8.0
    - Installation request for symfony/symfony 2.8.* -> satisfiable by symfony/symfony[v2.8.0, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.16, v2.8.17, v2.8.18, v2.8.19, v2.8.2, v2.8.20, v2.8.21, v2.8.22, v2.8.23, v2.8.24, v2.8.25, v2.8.26, v2.8.27, v2.8.28, v2.8.29, v2.8.3, v2.8.30, v2.8.31, v2.8.32, v2.8.33, v2.8.34, v2.8.35, v2.8.36, v2.8.37, v2.8.38, v2.8.39, v2.8.4, v2.8.40, v2.8.41, v2.8.42, v2.8.43, v2.8.44, v2.8.45, v2.8.46, v2.8.47, v2.8.48, v2.8.49, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].
    - Installation request for symfony/dom-crawler 2.3.* -> satisfiable by symfony/dom-crawler[v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.14, v2.3.15, v2.3.16, v2.3.17, v2.3.18, v2.3.19, v2.3.2, v2.3.20, v2.3.21, v2.3.22, v2.3.23, v2.3.24, v2.3.25, v2.3.26, v2.3.27, v2.3.28, v2.3.29, v2.3.3, v2.3.30, v2.3.31, v2.3.32, v2.3.33, v2.3.34, v2.3.35, v2.3.36, v2.3.37, v2.3.38, v2.3.39, v2.3.4, v2.3.40, v2.3.41, v2.3.42, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9].

这是我的composer.json文件的要求:

"require" : {
    "php" : ">=5.3.3",
    "symfony/symfony" : "2.8.*",
    "doctrine/orm": "2.4.*",
    "doctrine/doctrine-bundle" : "1.2.*",
    "doctrine/cache" : "1.5.*",
    "doctrine/common" : "2.5.*",
    "twig/extensions" : "1.3.*",
    "symfony/assetic-bundle" : "2.8.*",
    "symfony/swiftmailer-bundle" : "2.3.*",
    "symfony/monolog-bundle" : "2.3.*",
    "symfony/security-acl": "2.8.*",
    "sensio/distribution-bundle" : "2.3.*",
    "sensio/framework-extra-bundle" : "2.3.*",
    "sensio/generator-bundle" : "2.3.*",
    "incenteev/composer-parameter-handler" : "~2.0",

    "doctrine/doctrine-fixtures-bundle" : "3.0.*",
    "doctrine/migrations": "1.5.*",
    "doctrine/doctrine-migrations-bundle": "1.3.*",

    "sonata-project/admin-bundle": "2.3.*",
    "sonata-project/user-bundle" : "2.*",
    "sonata-project/doctrine-orm-admin-bundle": "2.*",

    "symfony/dom-crawler" : "2.3.*",
    "symfony/css-selector" : "2.3.*"
},

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

symfony/dom-crawler软件包已经包含DomCrawler组件(您尝试将其与2.3.x软件包一起安装)。这是Composer在较早版本中错误允许的,并已在Composer 1.7.3中修复。

您真的需要版本symfony/symfony中的Debug组件吗?在这种情况下,您需要先删除CssSelector并明确需要所有必需的组件。

顺便说一句,{{1}}组件也是如此。