【问题标题】:Could not parse version constraint >=1.9.1 <3.0: Invalid version string "1.9.1 <3.0" in GeneratorBundle无法解析版本约束 >=1.9.1 <3.0:GeneratorBundle 中的版本字符串“1.9.1 <3.0”无效
【发布时间】:2015-03-25 22:08:52
【问题描述】:

我正在尝试使用 Composer 为 Symfony 2.6 安装 GeneratorBundle。

我正在关注documentation。

但我收到以下 Composer 错误:

[UnexpectedValueException]
Could not parse version constraint >=1.9.1 I add "minimum-stability": "dev"

我尝试安装 AdmingeneratorGeneratorBundle,但出现了同样的问题。

你能帮帮我吗?

我的composer.json

    {
"name": "symfony/framework-standard-edition",
"minimum-stability": "dev",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.",
"doctrine/orm": "~2.2,>=2.2.3, "doctrine/dbal": " "doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"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",
"doctrine/doctrine-fixtures-bundle": "2.2.",
"friendsofsymfony/user-bundle": "~1.3",
"sonata-project/admin-bundle": "~2.3",
"sonata-project/doctrine-orm-admin-bundle": "~2.3",
"jms/serializer-bundle": "~0.13",
"sonata-project/media-bundle": "~2.3",
"vich/uploader-bundle": "0.14.",
"iphp/filestore-bundle":"0.2.",
"sonata-project/easy-extends-bundle": "~2.1",
"sonata-project/notification-bundle": "~2.3",
"videlalvaro/php-amqplib": "~2.5",
"liip/monitor-bundle": "~2.0",
"sonata-project/doctrine-extensions": "~1.0",
"cedriclombardot/admingenerator-user-bundle": "~1.1",
"cedriclombardot/admingenerator-generator-bundle": "~1.2@dev",
"symfony2admingenerator/generator-bundle": "~2.0@dev"
},
"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"
],
"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"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.6-dev"
}
}
}

也许有人知道 Symfony 的其他管理包,不管 sonataadminbundle 是什么?不是很困难的事情

【问题讨论】:

    标签: symfony composer-php admin-generator


    【解决方案1】:

    天啊,好多包啊。

    变化

    • 修复了类命名空间中的斜杠错误(安装命令)
    • 将iphp/filestore-bundle 移动到require-not-resolved 部分,表示无法解析此包。
    • 将 Symfony 版本提升到 2.6.0
    • 应用格式

    composer.json:

    {
        "name": "symfony/framework-standard-edition",
        "minimum-stability": "dev",
        "license": "MIT",
        "type": "project",
        "description": "The \"Symfony Standard Edition\" distribution",
        "autoload": {
            "psr-0": {
                "": "src/",
                "SymfonyStandard": "app/"
            }
        },
        "require": {
            "php": ">=5.3.3",
            "symfony/symfony": "2.6.0",
            "doctrine/orm": "~2.2,>=2.2.3",
            "doctrine/dbal": "*",
            "doctrine/doctrine-bundle": "~1.2",
            "twig/extensions": "~1.0",
            "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",
            "doctrine/doctrine-fixtures-bundle": "2.2.",
            "friendsofsymfony/user-bundle": "~1.3",
            "sonata-project/admin-bundle": "~2.3",
            "sonata-project/doctrine-orm-admin-bundle": "~2.3",
            "jms/serializer-bundle": "~0.13",
            "sonata-project/media-bundle": "~2.3",
            "vich/uploader-bundle": "0.14.",
            "sonata-project/easy-extends-bundle": "~2.1",
            "sonata-project/notification-bundle": "~2.3",
            "videlalvaro/php-amqplib": "~2.5",
            "liip/monitor-bundle": "~2.0",
            "sonata-project/doctrine-extensions": "~1.0",
            "cedriclombardot/admingenerator-user-bundle": "~1.1",
            "cedriclombardot/admingenerator-generator-bundle": "~1.2@dev",
            "symfony2admingenerator/generator-bundle": "~2.0@dev"
        },
        "require-dev": {
            "sensio/generator-bundle": "~2.3"
        },
        "require-not-resolved": {
            "iphp/filestore-bundle":"0.2."
        },
        "scripts": {
            "post-root-package-install": [
                "SymfonyStandard\\Composer::hookRootPackageInstall"
            ],
            "post-install-cmd": [
                "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\criptHandler::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"
                ],
            "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"
                ]
        },
        "config": {
            "bin-dir": "bin"
        },
        "extra": {
            "symfony-app-dir": "app",
            "symfony-web-dir": "web",
            "symfony-assets-install": "relative",
            "incenteev-parameters": {
                "file": "app/config/parameters.yml"
            },
            "branch-alias": {
                "dev-master": "2.6-dev"
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多