Symfony:您的要求无法解析为“composer install”

时间:2016-11-05 11:07:35

标签: php symfony composer-php

我为我的项目安装composer时遇到此错误。 这是我的composer.json

{
    "name": "accessleader/project",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-0": {
            "": "src/",
            "SymfonyStandard": "app/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": ">=5.4.26",
        "symfony/symfony": "2.6.*",
        "doctrine/orm": "~2.2,>=2.2.3,<2.5",
        "doctrine/dbal": "<2.5",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "1.0.1",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~3.0,>=3.0.12",
        "sensio/framework-extra-bundle": "~3.0,>=3.0.2",
        "incenteev/composer-parameter-handler": "~2.0",

        "knplabs/knp-paginator-bundle": "dev-master",
        "friendsofsymfony/user-bundle": "1.3.5",
        "adesigns/calendar-bundle" : "dev-master",
        "friendsofsymfony/jsrouting-bundle" : "1.5.4",
        "liip/imagine-bundle" : "dev-master",
        "jordillonch/crud-generator" : "dev-master",
        "stof/doctrine-extensions-bundle": "~1.1@dev",
        "kms/froala-editor-bundle": "dev-master",
        "webfactory/exceptions-bundle" : "dev-master",
        "lexik/translation-bundle": "~2.0",
        "jms/i18n-routing-bundle": "dev-master",
        "hwi/oauth-bundle": "dev-master",
        "liuggio/excelbundle": "^2.0",
        "a2lix/translation-form-bundle": "dev-master",
        "besimple/i18n-routing-bundle": "dev-master",
        "knplabs/doctrine-behaviors": "~1.1",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "unifik/database-config-bundle": "dev-master",
        "beelab/recaptcha2-bundle": "^0.1.0",
        "dario_swain/ds-recaptcha-bundle": "dev-master",
        "avocode/form-extensions-bundle": "dev-master",
        "gos/web-socket-bundle": "~1.0",
        "knplabs/knp-snappy-bundle": "^1.4"
    },
    "require-dev": {
        "sensio/generator-bundle": "~2.3"
    },
    "scripts": {
        "post-root-package-install": [
            "SymfonyStandard\\Composer::hookRootPackageInstall"
        ],
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/DataBase/parameters.yml"
        }
    }
}

我收到此错误:

  1. 问题1

    • twig / extensions 1.0.1的安装请求 - &gt;可以通过twig / extensions [v1.0.1]来满足。
    • avocode / form-extensions-bundle dev-master需要twig / extensions~1.2 - &gt;可以通过twig / extensions [1.4.x-dev]来满足。
    • 只能安装以下之一:twig / extensions [v1.0.1,1.4.x-dev]。
    • avocode / form-extensions-bundle dev-master的安装请求 - &gt;可以通过avocode / form-extensions-bundle [dev-master]来满足。

1 个答案:

答案 0 :(得分:0)

您已将SESSION_DRIVER=database固定到版本twig/extensions,但1.0.1至少需要avocode/form-extension-bundle版扩展程序才能生效。使用固定版本时,其他软件包不允许使用更高版本。

1.2

为了解决依赖性冲突,你需要一个更高,非固定版本(即允许所有版本,但不包括"require": "twig/extensions": "1.0.1", ),而不是你的新版本依赖性需求如下:

v2.0

或者您可以删除composer require 'twig/extensions:~1.2' 的显式依赖项,因为它已经是新包的依赖项,并且将与此包一起安装:

twig/extensions

然后安装所需的捆绑包:

composer remove 'twig/extensions'