相同的composer.json,相同的composer.lock但结果不同

时间:2019-01-15 15:21:55

标签: symfony composer-php

我正在处理一个托管在私有github上的项目。我正在克隆存储库并运行composer install

我要

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for symfony/symfony v2.7.38 -> satisfiable by symfony/symfony[v2.7.38].
    - don't install symfony/var-dumper v3.3.6|don't install symfony/symfony v2.7.38
    - Installation request for symfony/var-dumper v3.3.6 -> satisfiable by symfony/var-dumper[v3.3.6].

我不确定我明白这是什么意思。

这是我的composer.json

{
    "name": "…",
    "license": "…",
    "type": "…",
    "description": "…",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.4",
        "symfony/symfony": "2.7.*",
        "doctrine/orm": "^2.4.8",
        "doctrine/doctrine-bundle": "~1.4",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~4.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "~2.0",
        "twig/extensions": "1.0.*",

        "sonata-project/doctrine-orm-admin-bundle": "2.3.*",
        "sonata-project/admin-bundle": "2.3.*",
        "sonata-project/user-bundle": "2.2.*",
        "sonata-project/media-bundle": "2.3.*",
        "sonata-project/translation-bundle": "~1.0",
        "friendsofsymfony/jsrouting-bundle": "^2.0@dev",
        "friendsofsymfony/user-bundle": "1.3.*",
        "stof/doctrine-extensions-bundle": "~1.2",

        "doctrine/doctrine-migrations-bundle": "~1.1",

        "richsage/rms-push-notifications-bundle": "dev-master",

        "components/jquery": "2.1.1",
        "ckeditor/ckeditor": "4.4.5",

        "hwi/oauth-bundle": "0.3.*",
        "guzzlehttp/guzzle": "~5.0",
        "guzzlehttp/guzzle-services": "0.5.*",
        "mixpanel/mixpanel-php" : "2.*",
        "league/csv": "7.2.0",
        "friendsofsymfony/rest-bundle": "^1.7",
        "jms/serializer-bundle": "^1.1",
        "appventus/alertify-bundle":"dev-master",
        "dzunke/slack-bundle": "1.4.0",
        "algolia/algolia-search-bundle": "~1.0",
        "userscape/customerio": "^1.0",
        "dubture/customerio-bundle": "^0.0.1",
        "minube/amplitude-php": "dev-master",
        "stripe/stripe-php": "^3.11",
        "suncat/mobile-detect-bundle": "1.0.*",
        "willdurand/js-translation-bundle": "^2.5",
        "sentry/sentry-symfony": "^0.3.0",
        "jms/di-extra-bundle": "dev-master",
        "abraham/twitteroauth": "^0.7.1",
        "gos/web-socket-bundle": "dev-master",
        "phpoffice/phpexcel": "^1.8",
        "nelmio/api-doc-bundle": "~2.11",
        "liip/url-auto-converter-bundle": "dev-master",
        "dizda/onesignal-api-bundle": "^0.1.5",
        "slot/mandrill-bundle": "1.0.10"
    },
    "require-dev": {
        "phpunit/phpunit": "4.8.*@stable",
        "sensio/generator-bundle": "2.3.*",
        "symfony/var-dumper": "3.3.6",
        "doctrine/doctrine-fixtures-bundle": "^2.3",
        "deployer/deployer": "^5.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"
        }
    }
}

我的一位同事正在做完全相同的事情,并且正在工作。真的很高兴得到一些我根本不理解的关于作曲家错误的解释。

1 个答案:

答案 0 :(得分:1)

在比较composer命令的运行时经常会出现问题,这可能是由于使用不同版本而引起的。 由于每个发行版都进行了很多更改(例如,不同的glob排序顺序,它提供了不同的文件路径以及略微不同的regex以匹配软件包的版本), 最好的选择是通过在shell上运行composer -v来将您的版本与您的同行使用的版本进行比较(请查看链接以获取更多详细的示例和信息),并且我一如既往地建议保持如果没有严格要求,则每个人都可以通过运行composer self-update来使用最新版本。