Passport: Nova blocks the installation of Passport

Created on 21 Jan 2021  路  7Comments  路  Source: laravel/passport


  • Passport Version: v10.1.0
  • Laravel Version: v8.24.0
  • Nova Version: v3.9.4
  • PHP Version: 7.4.3

Description:

Passport requires a different version of phpseclib/phpseclib than laravel/nova. So it is currently not possible to use both.

Steps To Reproduce:

  1. composer require laravel/laravel
  2. composer require laravel/nova
  3. composer require laravel/passport

Using version ^10.1 for laravel/passport
./composer.json has been updated
Running composer update laravel/passport
Loading composer repositories with package information Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- laravel/passport[v10.1.0, ..., 10.x-dev] require phpseclib/phpseclib ^2.0 -> found phpseclib/phpseclib[2.0.0, ..., 2.0.x-dev] but the package is fixed to 3.0.x-dev (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 laravel/passport ^10.1 -> satisfiable by laravel/passport[v10.1.0, 10.x-dev].

needs more info

Most helpful comment

Yes, composer does have a bit of hiccup when you already installed a higher version of 3rd party package A which depends on package B not defined in the root composer.json and then installed another dependency that only support up to lower version of the same package B. This can be fixed either by following what you did above, or:

  • Remove composer.lock (and maybe vendor folder) before making composer require on the failed installation so we can have a clean requirement.
  • Explicitly set the lower requirement for phpseclib/phpseclib, but I wouldn't advise this unless you need to interact with the package directly.

All 7 comments

I don't see this dependency in Nova's dependencies?

/cc @crynobone

- Conclusion: don't install laravel/passport[v10.1.0] | install phpseclib/phpseclib[2.0.8] (conflict analysis result)
- Conclusion: don't install phpseclib/phpseclib 2.0.8 (conflict analysis result)
- moontoast/math 1.2.1 requires phpseclib/bcmath_compat >=1.0.3 -> satisfiable by phpseclib/bcmath_compat[2.0.0].
- laravel/nova v3.9.4 requires moontoast/math ^1.1 -> satisfiable by moontoast/math[1.2.1].
- Root composer.json requires laravel/passport ^10.1 -> satisfiable by laravel/passport[v10.1.0, 10.x-dev].

Ok, figured out the error:
Nova installs phpseclib/bcmath_compat v2.0.0 and that installs phpseclib/phpseclib v3.0.3.

In other words, if I install Passport before Nova, it works.

That shouldn't matter. Also: moontoast/math doesn't has the dependency you listed above (phpseclib/bcmath_compat). It requires bcmath: https://github.com/moontoast/math/blob/master/composer.json#L14

Are you using a shim?

Yes, composer does have a bit of hiccup when you already installed a higher version of 3rd party package A which depends on package B not defined in the root composer.json and then installed another dependency that only support up to lower version of the same package B. This can be fixed either by following what you did above, or:

  • Remove composer.lock (and maybe vendor folder) before making composer require on the failed installation so we can have a clean requirement.
  • Explicitly set the lower requirement for phpseclib/phpseclib, but I wouldn't advise this unless you need to interact with the package directly.

@crynobone Removing composer.lock before running compose require laravel/passport (without removing vendor/) works 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

soubhikchatterjee picture soubhikchatterjee  路  4Comments

brryfrmnn picture brryfrmnn  路  3Comments

rudolfdobias picture rudolfdobias  路  3Comments

ghost picture ghost  路  3Comments

mehrancodes picture mehrancodes  路  3Comments