phpcomposer-phpphp-7.3

PHP Composer dependencies conflict


I have a legacy application with PHP 7.3 and Composer v1.
There is an installed lcobucci/jwt:3.3.1 library.
The requirements for this library are very straightforward:

php: ^5.6 || ^7.0
ext-mbstring: *
ext-openssl: *

Now I would like to install auth0/login.
The last version that supports PHP 7.3 is 6.5.0, and has a bit more deps, but nothing too special:

php: ^7.3 || ^8.0
ext-filter: *
ext-json: *
ext-mbstring: *
ext-openssl: *
auth0/auth0-php: ^7.9
illuminate/contracts: ^6.0 || ^7.0 || ^8.0
illuminate/support: ^6.0 || ^7.0 || ^8.0

I can install them separately into the empty project.
But when I try to install them together, I get an error:

$ composer require auth0/login:6.5.0 lcobucci/jwt:3.3.1

Problem 1
    - Installation request for auth0/login 6.5.0 -> satisfiable by auth0/login[6.5.0].
    - lcobucci/jwt 3.3.1 conflicts with auth0/login[6.5.0].
    - Installation request for lcobucci/jwt 3.3.1 -> satisfiable by lcobucci/jwt[3.3.1].

Confusion explanation of Composer doesn't help.
Why these libraries cannot coexist in one project?


Solution

  • As you can see on packagist.org in the conflicts section for auth0/login, their maintainer declared a general conflict with lcobucci/jwt. That means, you cannot install any version of the JWT package alongside the auth0 package - when you want to use the most recent version of the v6 branch.

    This conflict was added in v6.4.1, so you might try to install v6.4 by running composer require auth0/login 6.4