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

Symfony 相同的composer.json,相同的composer.lock,但结果不同,symfony,composer-php,Symfony,Composer Php,我正在一个私人github上主持的项目上工作。我正在克隆repo并运行composer安装 我要走了 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. Pro

我正在一个私人github上主持的项目上工作。我正在克隆repo并运行
composer安装

我要走了

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"
        }
    }
}

我的一位同事也在做同样的事情,而且效果很好。我真的很高兴能得到一些关于composer错误的解释,但我完全不理解。

在比较composer命令的运行时经常出现的问题,可能是由于使用了不同的版本而产生的。 由于每个版本都有很多更改(例如不同的glob排序顺序,这会提供不同的文件路径以及稍微不同的正则表达式,以匹配包的版本),
最好的选择是将您的版本与您的同行正在使用的版本进行比较,方法是在您的计算机上运行
composer-v
(查看链接以获取更深入的示例和信息),和往常一样,如果没有严格要求使用较低版本,我建议通过运行
composer自我更新来保持每个人对最新版本的一致性。

我建议您将composer的版本与“-v”标志进行比较,如果您有不同的版本,结果可能会差异很大。除此之外,您可以随时删除vendor/composer.lock,并在更改某些内容时重试。@kawashita86我使用的是最新版本,我的同事使用的是1.6.5。它解决了这个问题。我不知道有那么大的不同。我怎么能接受你的评论作为回答?我把评论作为回答,这样你就可以接受了。很高兴能帮上忙:)