首页 > 解决方案 > 升级到 Laravel 7 时,symfony/http-kernel 5.0.x-dev 与 symfony/translation[v4.3.8] 冲突

问题描述

我正在尝试将 Laravel 从 6.x 升级到 7.x。但是,我收到了这个错误,我真的不知道这里发生了什么..

在我的composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "barryvdh/laravel-dompdf": "^0.8.4",
        "dpodsiadlo/svg-charts": "^1.0",
        "fideloper/proxy": "^4.0",
        "guzzlehttp/guzzle": "^7.0",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "phpoffice/phpspreadsheet": "^1.14",
        "predis/predis": "~1.1@dev",
        "symfony/translation": "4.3.8"
    },
    "require-dev": {
        "barryvdh/laravel-ide-helper": "^2.8",
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "laravel/browser-kit-testing": "2.*",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "files": ["app/Http/helpers.php"],
        "exclude-from-classmap": ["app/Http/Controllers/ZOld/"],
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "autoload-dev": {
        "files": ["app/Http/helpers.php"],
        "exclude-from-classmap": ["app/Http/Controllers/ZOld/"],
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

然后在做之后composer update我收到了这个..

  Problem 1
    - Conclusion: don't install laravel/framework v7.28.3
    - Conclusion: don't install laravel/framework v7.28.2
    - Conclusion: don't install laravel/framework v7.28.1
    - Conclusion: don't install laravel/framework v7.28.0
    - Conclusion: don't install laravel/framework v7.27.0
    - Conclusion: don't install laravel/framework v7.26.1
    - Conclusion: don't install laravel/framework v7.26.0
    - Conclusion: don't install laravel/framework v7.25.0
    - Conclusion: don't install laravel/framework v7.24.0
    - Conclusion: don't install laravel/framework v7.23.2
    - Conclusion: don't install laravel/framework v7.23.1
    - Conclusion: don't install laravel/framework v7.23.0
    - Conclusion: don't install laravel/framework v7.22.4
    - Conclusion: don't install laravel/framework v7.22.3
    - Conclusion: don't install laravel/framework v7.22.2
    - Conclusion: don't install laravel/framework v7.22.1
    - Conclusion: don't install laravel/framework v7.22.0
    - Conclusion: don't install laravel/framework v7.21.0
    - Conclusion: don't install laravel/framework v7.20.0
    - Conclusion: don't install laravel/framework v7.19.1
    - Conclusion: don't install laravel/framework v7.19.0
    - Conclusion: don't install laravel/framework v7.18.0
    - Conclusion: don't install laravel/framework v7.17.2
    - Conclusion: don't install laravel/framework v7.17.1
    - Conclusion: don't install laravel/framework v7.17.0
    - Conclusion: don't install laravel/framework v7.16.1
    - Conclusion: don't install laravel/framework v7.16.0
    - Conclusion: don't install laravel/framework v7.15.0
    - Conclusion: don't install laravel/framework v7.14.1
    - Conclusion: don't install laravel/framework v7.14.0
    - Conclusion: don't install laravel/framework v7.13.0
    - Conclusion: don't install laravel/framework v7.12.0
    - Conclusion: don't install laravel/framework v7.11.0
    - Conclusion: don't install laravel/framework v7.10.3
    - Conclusion: don't install laravel/framework v7.10.2
    - Conclusion: don't install laravel/framework v7.10.1
    - Conclusion: don't install laravel/framework v7.10.0
    - Conclusion: don't install laravel/framework v7.9.2
    - Conclusion: don't install laravel/framework v7.9.1
    - Conclusion: don't install laravel/framework v7.9.0
    - Conclusion: don't install laravel/framework v7.8.1
    - Conclusion: don't install laravel/framework v7.8.0
    - Conclusion: don't install laravel/framework v7.7.1
    - Conclusion: don't install laravel/framework v7.7.0
    - Conclusion: don't install laravel/framework v7.6.2
    - Conclusion: don't install laravel/framework v7.6.1
    - Conclusion: don't install laravel/framework v7.6.0
    - Conclusion: don't install laravel/framework v7.5.2
    - Conclusion: don't install laravel/framework v7.5.1
    - Conclusion: don't install laravel/framework v7.5.0
    - Conclusion: don't install laravel/framework v7.4.0
    - Conclusion: don't install laravel/framework v7.3.0
    - Conclusion: don't install laravel/framework v7.2.2
    - Conclusion: don't install laravel/framework v7.2.1
    - Conclusion: don't install laravel/framework v7.2.0
    - Conclusion: don't install laravel/framework v7.1.3
    - Conclusion: don't install laravel/framework v7.1.2
    - Conclusion: don't install laravel/framework v7.1.1
    - Conclusion: don't install laravel/framework v7.1.0
    - Conclusion: don't install laravel/framework v7.0.8
    - Conclusion: don't install laravel/framework v7.0.7
    - Conclusion: don't install laravel/framework v7.0.6
    - Conclusion: don't install laravel/framework v7.0.5
    - Conclusion: don't install laravel/framework v7.0.4
    - Conclusion: don't install laravel/framework v7.0.3
    - Conclusion: don't install laravel/framework v7.0.2
    - Conclusion: don't install laravel/framework v7.0.1
    - Conclusion: don't install laravel/framework v7.0.0
    - Installation request for laravel/framework ^7.0 -> satisfiable by laravel/framework[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.10.0, v7.10.1, v7.10.2, v7.10.3, v7.11.0, v7.12.0, v7.13.0, v7.14.0, v7.14.1, v7.15.0, v7.16.0, v7.16.1, v7.17.0, v7.17.1, v7.17.2, v7.18.0, v7.19.0, v7.19.1, v7.2.0, v7.2.1, v7.2.2, v7.20.0, v7.21.0, v7.22.0, v7.22.1, v7.22.2, v7.22.3, v7.22.4, v7.23.0, v7.23.1, v7.23.2, v7.24.0, v7.25.0, v7.26.0, v7.26.1, v7.27.0, v7.28.0, v7.28.1, v7.28.2, v7.28.3, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2, v7.6.0, v7.6.1, v7.6.2, v7.7.0, v7.7.1, v7.8.0, v7.8.1, v7.9.0, v7.9.1, v7.9.2].
    - Conclusion: remove symfony/translation v4.3.8
    - laravel/framework 7.x-dev requires symfony/http-kernel ^5.0 -> satisfiable by symfony/http-kernel[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, v5.0.0, v5.0.0-BETA1, v5.0.0-BETA2, v5.0.0-RC1, v5.0.1, v5.0.10, v5.0.11, v5.0.2, v5.0.3, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9, v5.1.0, v5.1.0-BETA1, v5.1.0-RC1, v5.1.0-RC2, v5.1.1, v5.1.2, v5.1.3, v5.1.4, v5.1.5, v5.1.6, v5.1.7].
    - symfony/http-kernel 5.0.x-dev conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel 5.1.x-dev conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel 5.2.x-dev conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.0 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.0-BETA1 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.0-BETA2 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.0-RC1 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.1 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.10 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.11 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.2 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.3 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.4 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.5 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.6 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.7 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.8 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.0.9 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.0 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.0-BETA1 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.0-RC1 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.0-RC2 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.1 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.2 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.3 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.4 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.5 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.6 conflicts with symfony/translation[v4.3.8].
    - symfony/http-kernel v5.1.7 conflicts with symfony/translation[v4.3.8].
    - Installation request for symfony/translation 4.3.8 -> satisfiable by symfony/translation[v4.3.8].

有一行写着结论:删除 symfony/translation v4.3.8.. 但如果我删除它可能会影响我网站上的翻译?

标签: phplaravelsymfony

解决方案


在你 composer.json

更新为 laravel 7 所需Symfony 5组件

"symfony/translation": "5.1.7"

最新版本可以在这里找到https://github.com/symfony/translation/tags


推荐阅读