28

Recently I upgraded this website to Drupal 10.2. This couldn't be easier with a Composer and I am grateful for all the hard work that went into this dependency manager.

While Composer allows for more granular updates, I often prefer doing composer update which updates all dependencies at once. This is a good strategy especially when working on a smaller project (like this one) AND doing updates regularly.

On some occasions, you may find out that a particular dependency, be a Drupal Core (drupal/core-recommended), is not upgraded to its most recent MINOR version, despite the version constraint allowing for such an update. In such case, I use one of two options:

  1. composer why-not drupal/core-recommended 10.2.2 - use the following to learn why the expected version can't be installed. Then resolve all issues one by one as suggested by the output.

  2. Manually bump version constraint in composer.json file, ie. "drupal/core-recommended": "^10.2.2" and run composer update again. If Composer detects conflicts it will tell you about it.

Hint: If you only want to upgrade the specific dependency with the method 2 try adding the dependency name into the command, ie. composer update drupal/core-recommended