【问题标题】:Getting error while installing SyliusCartBundle with composer使用 composer 安装 SyliusCartBundle 时出错
【发布时间】:2015-02-03 12:36:17
【问题描述】:

我正在尝试使用 composer 在我的 Symfony2 应用程序中安装 SyliusCartBundle,请帮助我节省一天的时间。

在与它需要的 Bundle 关联的 composer.json 中:

    "php": ">=5.3.3",
    "symfony/framework-bundle": "~2.3",
    "sylius/order-bundle":      "0.12.*@dev",
    "sylius/money-bundle":      "0.12.*@dev",
    "sylius/resource-bundle":   "0.12.*@dev",
    "sylius/cart":              "0.12.*@dev"

这是我用来安装包的命令行

composer require "sylius/cart-bundle:0.12.0"

但我收到此错误:

这是我的 composer.json :

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "~2.0"
},
"scripts": {
    "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"
    ],
    "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"
    ]
},
"config": {
    "bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.3-dev"
    }
}

}

【问题讨论】:

    标签: symfony composer-php sylius


    【解决方案1】:

    您需要重写您的 composer json 文件以满足 SyliusCartBundle 的要求(doctrine-bundle with version ~1.3):

    "require": {
        ...
        "doctrine/doctrine-bundle": "~1.3",
        ...
    },
    

    【讨论】:

    • 更新我的 composer.json 文件后我需要运行的作曲家命令行是什么。
    • 您可以运行composer update 或使用您的命令:composer require "sylius/cart-bundle:0.12.0"
    • 我跑了composer update 然后composer require "sylius/cart-bundle:0.12.0" 运行良好。非常感谢迈克尔
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-01
    • 2017-04-09
    • 2021-04-16
    • 2021-09-10
    • 2014-01-12
    • 2017-10-10
    • 2019-05-01
    相关资源
    最近更新 更多