Score:0

Upgrading to Composer 2 blocked by Symfony dependecies

us flag

I have an existing Drupal 8.9.16 site which uses Composer 1 (and Commerce 2.24). I am trying to upgrade to using Composer 2 using this guide: https://www.drupal.org/docs/develop/using-composer/preparing-your-site-for-composer-2.

I have gotten through all the required steps up to the last step of dealing with drupal-scaffold (https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold#s-migrating-composer-scaffold). The last step of that is to require drupal/core-recommended:^8.9. As I don't want to update core right now I am trying to run:

composer require drupal/core-recommended:8.9.16

but I am blocked by:

  • Can only install one of: symfony/yaml[v3.4.41, v3.4.47].
  • drupal/core-recommended 8.9.19 requires symfony/yaml v3.4.41 -> satisfiable by symfony/yaml[v3.4.41].

As a guess, I try requiring symfony/yaml:3.4.41. This fixes this issue and then moves on to the next symfony plugin which generates a similar error. Started going through all of these but there are a lot of symphony plugins and this can't possibly be the right way to do this.

What am I missing here?

cn flag
Have you tried `composer require drupal/core-recommended:8.9.16 -w`? That will do any dependency updates along with the require. If you happen to be requiring any of the dependencies that are causing issues in your own composer.json, try the `-W` flag instead. See https://getcomposer.org/doc/03-cli.md#require for more info
liquidcms avatar
us flag
There is no -w or -W option. BTW - i am doing this all still with Composer 1 as that is what the d.org guide states.
cn flag
I didn't realise the alias wasn't available in Composer 1 - the option is though, use `--update-with-dependencies` instead
liquidcms avatar
us flag
Same error. I suspect something is forcing 3.4.47 and since i can require 3.4.41; wonder if there isn't some way to replace all the symfony plugins at once?
Score:2
us flag

As is usually the fix, deleting the vendor folder and composer.lock file and then running:

  • composer require drupal/core-recommended:8.9.16 --update-with-dependencies seems to have fixed the problem.

Since I deleted the .lock file it effectively runs a composer update which updated a few of the contrib modules. Not what i wanted; but I could have locked them in where they were if i was that worried about it. Core and Commerce were fixed to the version I was using so this remain untouched.

After that i was able to selfupdate to composer 2.x.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.