0

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?

4
  • 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 getcomposer.org/doc/03-cli.md#require for more info
    – Clive
    Commented Nov 11, 2021 at 19:40
  • 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.
    – liquidcms
    Commented Nov 11, 2021 at 19:49
  • I didn't realise the alias wasn't available in Composer 1 - the option is though, use --update-with-dependencies instead
    – Clive
    Commented Nov 11, 2021 at 19:59
  • 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?
    – liquidcms
    Commented Nov 11, 2021 at 22:05

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.