Skip to content

Fresh Laravel 10 installation needs to downgrade psr/http-message #682

Closed
@uandco

Description

Environment

Laravel v10.8.0 (PHP v8.2.4)

Steps to Reproduce

  • Install a brand new Laravel 10 via composer create-project --prefer-dist laravel/laravel:^10.0 laravel10
  • Run composer require sentry/sentry-laravel

Expected Result

The package should install without dependency issues.

Actual Result

Getting these errors:

composer require sentry/sentry-laravel
Info from https://repo.packagist.org: #StandWithUkraine
./composer.json has been updated
Running composer update sentry/sentry-laravel
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - sentry/sentry-laravel[3.2.0, ..., 3.3.3] require symfony/psr-http-message-bridge ^1.0 | ^2.0 -> satisfiable by symfony/psr-http-message-bridge[v1.0.0, ..., v1.3.0, v2.0.0, ..., v2.1.4].
    - sentry/sentry-laravel[0.1.0, ..., 0.8.2] require illuminate/support 4.*|5.* -> found illuminate/support[v4.0.0, ..., v4.2.17, v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
    - sentry/sentry-laravel[0.9.0, ..., 0.11.0] require php ^5.4||^7.0 -> your php version (8.2.4) does not satisfy that requirement.
    - sentry/sentry-laravel[1.0.0, ..., 1.9.0] require php ^7.1 -> your php version (8.2.4) does not satisfy that requirement.
    - symfony/psr-http-message-bridge[v1.2.0, ..., v1.3.0, v2.0.0] require php ^7.1 -> your php version (8.2.4) does not satisfy that requirement.
    - sentry/sentry-laravel[2.0.0, ..., 2.3.0] require php ^7.2 -> your php version (8.2.4) does not satisfy that requirement.
    - sentry/sentry-laravel[2.3.1, ..., 2.10.2] require illuminate/support 5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 -> found illuminate/support[v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
    - sentry/sentry-laravel[2.11.0, ..., 2.14.2] require illuminate/support 5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 -> found illuminate/support[v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.6] but these were not loaded, likely because it conflicts with another require.
    - sentry/sentry-laravel[3.0.0, ..., 3.1.3] require illuminate/support ^6.0 | ^7.0 | ^8.0 | ^9.0 -> found illuminate/support[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.6] but these were not loaded, likely because it conflicts with another require.
    - symfony/psr-http-message-bridge[v1.0.0, ..., v1.0.2] require psr/http-message ~1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - symfony/psr-http-message-bridge[v1.1.0, ..., v1.1.2] require php ^5.3.3 || ^7.0 -> your php version (8.2.4) does not satisfy that requirement.
    - symfony/psr-http-message-bridge[v2.0.1, ..., v2.1.4] require psr/http-message ^1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires sentry/sentry-laravel * -> satisfiable by sentry/sentry-laravel[0.1.0, ..., 0.11.0, 1.0.0, ..., 1.9.0, 2.0.0, ..., 2.14.2, 3.0.0, ..., 3.3.3].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require sentry/sentry-laravel:*" to figure out if any version is installable, or "composer require sentry/sentry-laravel:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

When running again with the -W option, the package installs, at the cost of downgrading psr/http-message (2.0 => 1.1):

composer require sentry/sentry-laravel --with-all-dependencies
./composer.json has been updated
Running composer update sentry/sentry-laravel --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 17 installs, 1 update, 0 removals
  - Locking clue/stream-filter (v1.6.0)
  - Locking http-interop/http-factory-guzzle (1.2.0)
  - Locking jean85/pretty-package-versions (2.0.5)
  - Locking nyholm/psr7 (1.6.1)
  - Locking php-http/client-common (2.6.1)
  - Locking php-http/discovery (1.15.3)
  - Locking php-http/httplug (2.4.0)
  - Locking php-http/message (1.14.0)
  - Locking php-http/message-factory (1.1.0)
  - Locking php-http/promise (1.1.0)
  - Downgrading psr/http-message (2.0 => 1.1)
  - Locking sentry/sdk (3.3.0)
  - Locking sentry/sentry (3.17.0)
  - Locking sentry/sentry-laravel (3.3.3)
  - Locking symfony/http-client (v6.2.9)
  - Locking symfony/http-client-contracts (v3.2.1)
  - Locking symfony/options-resolver (v6.2.7)
  - Locking symfony/psr-http-message-bridge (v2.1.4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 17 installs, 1 update, 0 removals
  - Downloading php-http/discovery (1.15.3)
  - Downloading psr/http-message (1.1)
  - Downloading http-interop/http-factory-guzzle (1.2.0)
  - Downloading jean85/pretty-package-versions (2.0.5)
  - Downloading symfony/options-resolver (v6.2.7)
  - Downloading php-http/message-factory (1.1.0)
  - Downloading clue/stream-filter (v1.6.0)
  - Downloading php-http/message (1.14.0)
  - Downloading php-http/promise (1.1.0)
  - Downloading php-http/httplug (2.4.0)
  - Downloading php-http/client-common (2.6.1)
  - Downloading symfony/psr-http-message-bridge (v2.1.4)
  - Downloading nyholm/psr7 (1.6.1)
  - Downloading symfony/http-client-contracts (v3.2.1)
  - Downloading symfony/http-client (v6.2.9)
  - Downloading sentry/sentry (3.17.0)
  - Downloading sentry/sentry-laravel (3.3.3)
  - Installing php-http/discovery (1.15.3): Extracting archive
  - Downgrading psr/http-message (2.0 => 1.1): Extracting archive
  - Installing http-interop/http-factory-guzzle (1.2.0): Extracting archive
  - Installing jean85/pretty-package-versions (2.0.5): Extracting archive
  - Installing symfony/options-resolver (v6.2.7): Extracting archive
  - Installing php-http/message-factory (1.1.0): Extracting archive
  - Installing clue/stream-filter (v1.6.0): Extracting archive
  - Installing php-http/message (1.14.0): Extracting archive
  - Installing php-http/promise (1.1.0): Extracting archive
  - Installing php-http/httplug (2.4.0): Extracting archive
  - Installing php-http/client-common (2.6.1): Extracting archive
  - Installing symfony/psr-http-message-bridge (v2.1.4): Extracting archive
  - Installing nyholm/psr7 (1.6.1): Extracting archive
  - Installing symfony/http-client-contracts (v3.2.1): Extracting archive
  - Installing symfony/http-client (v6.2.9): Extracting archive
  - Installing sentry/sentry (3.17.0): Extracting archive
  - Installing sentry/sdk (3.3.0)
  - Installing sentry/sentry-laravel (3.3.3): Extracting archive
5 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions