Updating Larael from 5.1.35 to 5.2.* - fails to up

2019-09-19 19:14发布

问题:

I am trying to upgrade Laravel 5.1.35 to Laravel 5.2 and I am getting the following error:

Problem 1
    - laravel/framework v5.1.35 requires symfony/css-selector 2.7.* -> satisfiable by symfony/css-selector[2.7.x-dev, v2.7.0, v2.7.0-BETA1, v2.7.0-BETA2, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9] but these conflict with your requirements or minimum-stability.
    - Conclusion: don't install laravel/framework v5.2.43
    - Conclusion: don't install laravel/framework v5.2.42
    - Conclusion: don't install laravel/framework 5.2.41
    - Conclusion: don't install laravel/framework v5.2.40
    - Conclusion: don't install laravel/framework v5.2.39
    - Conclusion: don't install laravel/framework v5.2.38
    - Conclusion: don't install laravel/framework v5.2.37
    - Conclusion: don't install laravel/framework v5.2.36
    - Conclusion: don't install laravel/framework v5.2.35
    - Conclusion: don't install laravel/framework v5.2.34
    - Conclusion: don't install laravel/framework v5.2.33
    - Conclusion: don't install laravel/framework v5.2.32
    - Conclusion: don't install laravel/framework v5.2.31
    - Conclusion: don't install laravel/framework v5.2.30
    - Conclusion: don't install laravel/framework v5.2.29
    - Conclusion: don't install laravel/framework v5.2.28
    - Conclusion: don't install laravel/framework v5.2.27
    - Conclusion: don't install laravel/framework v5.2.26
    - Conclusion: don't install laravel/framework v5.2.25
    - Conclusion: don't install laravel/framework v5.2.24
    - Conclusion: don't install laravel/framework v5.2.23
    - Conclusion: don't install laravel/framework v5.2.22
    - Conclusion: don't install laravel/framework v5.2.21
    - Conclusion: don't install laravel/framework v5.2.20
    - Conclusion: don't install laravel/framework v5.2.19
    - Conclusion: don't install laravel/framework v5.2.18
    - Conclusion: don't install laravel/framework v5.2.17
    - Conclusion: don't install laravel/framework v5.2.16
    - Conclusion: don't install laravel/framework v5.2.15
    - Conclusion: don't install laravel/framework v5.2.14
    - Conclusion: don't install laravel/framework v5.2.13
    - Conclusion: don't install laravel/framework v5.2.12
    - Conclusion: don't install laravel/framework v5.2.11
    - Conclusion: don't install laravel/framework v5.2.10
    - Conclusion: don't install laravel/framework v5.2.9
    - Conclusion: don't install laravel/framework v5.2.8
    - Conclusion: don't install laravel/framework v5.2.7
    - Conclusion: don't install laravel/framework v5.2.6
    - Conclusion: don't install laravel/framework v5.2.5
    - Conclusion: don't install laravel/framework v5.2.4
    - Conclusion: don't install laravel/framework v5.2.3
    - Conclusion: don't install laravel/framework v5.2.2
    - Conclusion: don't install laravel/framework v5.2.1
    - lucadegasperi/oauth2-server-laravel 5.0.3 requires illuminate/http 5.1.* -> satisfiable by laravel/framework[v5.1.35], illuminate/http[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8].
    - lucadegasperi/oauth2-server-laravel 5.0.2 requires illuminate/http 5.1.* -> satisfiable by laravel/framework[v5.1.35], illuminate/http[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8].
    - lucadegasperi/oauth2-server-laravel 5.0.1 requires illuminate/http 5.1.* -> satisfiable by laravel/framework[v5.1.35], illuminate/http[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8].
    - lucadegasperi/oauth2-server-laravel 5.0.0 requires illuminate/http 5.1.* -> satisfiable by laravel/framework[v5.1.35], illuminate/http[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8].
    - lucadegasperi/oauth2-server-laravel 5.0.3 requires illuminate/http 5.1.* -> satisfiable by laravel/framework[v5.1.35], illuminate/http[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8].
    - don't install illuminate/http v5.1.1|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.13|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.16|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.2|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.20|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.22|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.25|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.28|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.30|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.31|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.41|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.6|don't install laravel/framework v5.2.0
    - don't install illuminate/http v5.1.8|don't install laravel/framework v5.2.0
    - Installation request for laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.41, v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
    - Installation request for lucadegasperi/oauth2-server-laravel 5.0.* -> satisfiable by lucadegasperi/oauth2-server-laravel[5.0.0, 5.0.1, 5.0.2, 5.0.3].

I understand that some of the packages do not yet support Laravel 5.2, but it is explicitly told in the manual (https://laravel.com/docs/5.2/upgrade) that I should add the following line to my composer.json

"symfony/css-selector": "~3.0"

However, it seems like this package is what causes the problem. How do I proceed with my update? Thank you.

Here is my full composer.json

{
  "name": "laravel/laravel",
  "description": "The Laravel Framework.",
  "keywords": [
    "framework",
    "laravel"
  ],
  "license": "MIT",
  "type": "project",
  "require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "aws/aws-sdk-php-laravel": "~3.0",
    "vinkla/hashids": "^1.1",
    "cartalyst/sentinel": "~2.0.1",
    "baum/baum": "~1.1",
    "robclancy/presenter": "1.3.*",
    "barryvdh/laravel-ide-helper": "^2.0",
    "league/flysystem-aws-s3-v3": "~1.0",
    "intervention/image": "^2.2",
    "rap2hpoutre/laravel-log-viewer": "^0.2.8",
    "league/fractal": "^0.12.0",
    "ramsey/uuid": "~2.8",
    "lucadegasperi/oauth2-server-laravel": "5.0.*",
    "torann/geoip": "0.2.*@dev",
    "mailchimp/mailchimp": "^2.0",
    "iron-io/iron_mq": "~2.0",
    "aws/aws-sdk-php": "~3.0",
    "justinrainbow/json-schema": "~1.3",
    "sybio/gif-frame-extractor": "^1.0",
    "coldume/imagecraft": "dev-gif-optimization",
    "pragmarx/firewall": "^0.5.2",
    "get-stream/stream-laravel": "dev-master",
    "roumen/sitemap": "2.5.*",
    "guzzlehttp/guzzle": "~6.0",
    "bugsnag/bugsnag-laravel": "1.*",
    "cviebrock/image-validator": "^2.0",
    "toin0u/geocoder-laravel": "@stable",
    "badawy/embedly": "^1.0",
    "facebook/webdriver": "^1.0",
    "scotteh/php-dom-wrapper": "dev-composer-symfony-fix",
    "scotteh/php-goose": "dev-composer-guzzle-fix",
    "doctrine/dbal": "^2.5",
    "mandrill/mandrill": "1.0.*"
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/zmike808GS/imagecraft"
    },
    {
      "type": "vcs",
      "url": "https://github.com/zmike808GS/php-goose"
    },
    {
      "type": "vcs",
      "url": "https://github.com/zmike808GS/php-dom-wrapper"
    }
  ],
  "require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1",
    "laracasts/testdummy": "~2.0",
    "symfony/dom-crawler": "~3.0",
    "symfony/css-selector": "~3.0"
  },
  "autoload": {
    "classmap": [
      "database"
    ],
    "psr-4": {
      "**************": "*********"
    }
  },
  "autoload-dev": {
    "classmap": [
      "tests"
    ]
  },
  "scripts": {
    "post-install-cmd": [
      "php artisan clear-compiled",
      "php artisan optimize"
    ],
    "pre-update-cmd": [
      "php artisan clear-compiled"
    ],
    "post-update-cmd": [
      "php artisan clear-compiled",
      "php artisan ide-helper:generate",
      "php artisan optimize"
    ],
    "post-root-package-install": [
      "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
      "php artisan key:generate"
    ]
  },
  "config": {
    "preferred-install": "dist",
    "github-oauth": {
      "github.com": "********************************************"
    }
  }
}

回答1:

You are explicitly requiring lucadegasperi/oauth2-server-laravel version 5.0.*, which itself depends on Illuminate version 5.1.*. This dependency comes from Laravel 5.1, which conflicts with your upgrade to 5.2.

If your lucadegasperi/oauth2-server-laravel dependency to ~5.1 (which depends on 5.1.* || 5.2.*) or greater (~5.2 depends on 5.1.* || 5.2.* || 5.3.*) the conflict should no longer appear. Of course, you should review any changes to that library that might impact your application.