суббота, 26 ноября 2022 г.

Composer upgrade not working fix

When you want do single package upgrade like `composer update willdurand/hateoas --with-all-dependencies` and you have errors like this:

Your requirements could not be resolved to an installable set of packages:


  Problem 1

    - Root composer.json requires willdurand/hateoas ^3.8, found willdurand/hateoas[3.8.0] but these were not loaded, likely because it conflicts with another require.

  Problem 2

    - willdurand/hateoas-bundle 1.4.0 requires willdurand/hateoas ^2.10.0 -> found willdurand/hateoas[2.10.0, 2.11.0, 2.12.0] but it conflicts with your root composer.json require (^3.8).

    - sylius/resource-bundle v1.6.4 requires willdurand/hateoas-bundle ^1.2 -> satisfiable by willdurand/hateoas-bundle[1.4.0].

    - sylius/resource-bundle is locked to version v1.6.4 and an update of this package was not requested.


It means you need to go up by dependency tree and do `upgrade` manually. In my case I need to set "sylius/resource-bundle" to "^1.8", then run "composer update sylius/resource-bundle --with-all-dependencies" and finally run first command