0

My question is specific to Composer.

Context

I'm in the midst of upgrading a number of my packages to work with Laravel 10 and re-versioning was going fine until I was stumped by this Problem. Been stuck at it for a few hours now, would appeciate if someone can guide me on where to look. Thank you.

$ composer update -W
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires me/mypackage dev-10.x|^10 -> satisfiable by me/mypackage[10.x-dev].
    - Conclusion: don't install illuminate/console v10.17.0 (conflict analysis result)
    - Conclusion: don't install symfony/console v6.3.2 (conflict analysis result)
    - Root composer.json requires laravel/sanctum ^3.2 -> satisfiable by laravel/sanctum[v3.2.0, ..., 3.x-dev].
    - Root composer.json requires laravel/framework ^10 -> satisfiable by laravel/framework[v10.0.0, ..., 10.x-dev].
    - Root composer.json requires nunomaduro/collision ^5.10 -> satisfiable by nunomaduro/collision[v5.10.0, v5.11.0, v5.x-dev].
    - Conclusion: don't install symfony/console v6.2.13 (conflict analysis result)
    - illuminate/console[v9.21.0, ..., 9.x-dev] require illuminate/contracts ^9.0 -> satisfiable by illuminate/contracts[v9.0.0-beta.1, ..., 9.x-dev].
    - Conclusion: don't install illuminate/contracts v9.52.13 (conflict analysis result)
    - laravel/sanctum[v3.2.0, ..., 3.x-dev] require illuminate/console ^9.21|^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., 10.x-dev], illuminate/console[v9.21.0, ..., 9.x-dev, v10.0.0, ..., 10.x-dev].
    - laravel/framework[v10.0.0, ..., 10.x-dev] require symfony/console ^6.2 -> satisfiable by symfony/console[v6.2.0-BETA1, ..., 6.4.x-dev].
    - illuminate/console[v10.0.0, ..., v10.16.1] require symfony/console ^6.2 -> satisfiable by symfony/console[v6.2.0-BETA1, ..., 6.4.x-dev].
    - Conclusion: don't install symfony/console 6.4.x-dev (conflict analysis result)

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

UPDATE

My question is specific to understanding/decoding/deciphering Composer Problem output. I already solved the issue above and don't need its solution. Rather, how do I derive a solution based on the output above, because this seem to be a case where the output doesn't seem to point to the offending dependency.

Think of it as teaching a man how to fish. :) A step by step guide with explanation would be helpful. Thank you.

bilogic
  • 449
  • 3
  • 18
  • See if there are any new versions for `laravel/sanctum` and `nunomaduro/collision` – UnderDog Aug 02 '23 at 04:50
  • 1
    thanks, I eventually overcame it by following the upgrade guide here https://laravel.com/docs/10.x/upgrade#updating-dependencies to make modifications to composer.json, but what I was hoping to understand is how to translate the problem output into corrective actions – bilogic Aug 02 '23 at 05:17
  • The way I looked at it is as follows: 1) check for any packages in the error message, that does not belong to `Illuminate` or `symfony`. Sanctum and Collision stood out. Just knowing that Sanctum might have a newer version that was one of the options. *Process of elimination*? – UnderDog Aug 02 '23 at 05:24

1 Answers1

0

nunomaduro/collision in v5 is pretty outdated (last update more than a year ago!) and not compatible with Symfony v6, but laravel/framework v10 explicitly requires Symfony v6.

It should help to update nunomaduro/collision to a more current version.

Nico Haase
  • 11,420
  • 35
  • 43
  • 69
  • Thanks this is pretty contextual info and not what I was trying to ask for. Updated my OP. – bilogic Aug 02 '23 at 10:49
  • "A step by step guide with explanation would be helpful" - that's not that simple, as Composer's output is usually a bit hard to understand. But `composer why-not` could help, did you check that? – Nico Haase Aug 02 '23 at 11:26