【问题标题】:Composer requirements could not be resolved to an installable set of packages无法将 Composer 要求解析为可安装的软件包集
【发布时间】:2016-09-05 20:00:01
【问题描述】:

我正在使用 symfony3 构建一个 web 应用程序,当我尝试安装几个外部包时,我得到了

您的要求无法解决为一组可安装的 包。

我尝试使用选项--ignore-platform-reqs,但同样的事情发生了。 这些捆绑包只适用于 symfony2?我认为 symfony3 是完全向后兼容的? 为了进行安装,composer 是否有更多配置?

PS:PHP 5.5.8

编辑:composer.json

{
  "name": "dell/.checkout",
  "license": "proprietary",
  "type": "project",
  "autoload": {
    "psr-4": {
      "": "src/"
    },
    "classmap": [
      "app/AppKernel.php",
      "app/AppCache.php"
    ]
  },
  "autoload-dev": {
    "psr-4": {
      "Tests\\": "tests/"
    }
  },
  "require": {
    "php": ">=5.5.9",
    "symfony/symfony": "3.0.*",
    "doctrine/orm": "^2.5",
    "doctrine/doctrine-bundle": "^1.6",
    "doctrine/doctrine-cache-bundle": "^1.2",
    "symfony/swiftmailer-bundle": "^2.3",
    "symfony/monolog-bundle": "^2.8",
    "sensio/distribution-bundle": "^5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "^2.0",
    "symfony/assetic-bundle": "v2.8.0",
    "friendsofsymfony/jsrouting-bundle": "2.0.0-alpha1",
    "blackknight467/star-rating-bundle": "v2.0.1",
    "nomaya/social-bundle": "dev-master",
    "payum/payum-bundle": "2.0.1"
  },
  "require-dev": {
    "sensio/generator-bundle": "^3.0",
    "symfony/phpunit-bridge": "^3.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",
      "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::prepareDeploymentTarget"
    ]
  },
  "config": {
    "platform": {
      "php": "5.5.9"
    }
  },
  "extra": {
    "symfony-app-dir": "app",
    "symfony-bin-dir": "bin",
    "symfony-var-dir": "var",
    "symfony-web-dir": "web",
    "symfony-tests-dir": "tests",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
      "file": "app/config/parameters.yml"
    }
  }
}

【问题讨论】:

  • 取决于捆绑包是否与新的 sf3 版本对齐。尝试发布您的composer.json 文件
  • @Matteo 但为什么它不起作用?反正它向后兼容吗? (用 composer.json 更新)
  • ignore-platform-reqs 仅跳过平台要求(即 php 版本等)检查docs
  • 所以没有解决办法?
  • 您应该修复捆绑包依赖关系。 :(

标签: composer-php symfony


【解决方案1】:

根据this issue on Githubnomaya/social-bundle 的所有者不打算支持 Symfony 3,因此您可能会看到向后兼容性问题。可能还有更多,但这是我发现的第一个。

Symfony's Backwards Compatability Promise 这么说:

确保您的项目顺利升级是我们的首要任务。 这就是为什么我们向您保证所有未成年人的向后兼容性 (BC) Symfony 发布。您可能将此策略识别为语义 版本控制。简而言之,语义版本控制意味着只有 ma​​jor 允许发布(例如 2.0、3.0 等)向后中断 兼容性。次要版本(例如 2.5、2.6 等)可能会引入 新功能,但必须在不破坏现有 API 的情况下这样做 发布分支(上例中为 2.x)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-21
    • 1970-01-01
    • 2018-01-11
    • 2014-06-10
    • 2016-11-10
    • 2020-02-12
    • 2017-12-07
    相关资源
    最近更新 更多