1

I am trying to install CiviCRM on a Drupal 8 site using Composer 2. I am getting the error below. Is this a Composer 2 issue? Do I need to revert to Composer 1? Is there a different fix? Thx.

=======================================

composer require civicrm/civicrm-{core,packages,drupal-8}:'~5.36'

./composer.json has been updated Running composer update civicrm/civicrm-core civicrm/civicrm-packages civicrm/civicrm-drupal-8 Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1 - civicrm/civicrm-core[5.36.0, ..., 5.37.x-dev] require symfony/finder ~3.0 || ~4.4 -> found symfony/finder[v3.0.0-BETA1, ..., 3.4.x-dev, v4.4.0-BETA1, ..., 4.4.x-dev] but the package is fixed to v5.2.4 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - Root composer.json requires civicrm/civicrm-core ~5.36 -> satisfiable by civicrm/civicrm-core[5.36.0, 5.36.1, 5.36.x-dev, 5.37.x-dev].

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

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

4
  • Based on the error message, I would try removing composer.lock and the entire vendor folder and also web/modules/contrib/civicrm then trying again. It sounds like an earlier attempt failed and it's now in a stuck situation. Composer 2 should work, but also is this drupal 8 or 9?
    – Demerit
    Commented Apr 27, 2021 at 17:06
  • 1
    @Demerit, Thank you very much. Your suggestions worked. This is on a Drupal 8 site that I used a theme demo as the starter. That might have created a bit of a goofy setup to begin with. Thanks again!
    – Marv S
    Commented Apr 27, 2021 at 17:49
  • Great, glad it worked.
    – Demerit
    Commented Apr 27, 2021 at 18:07
  • Just to keep the record going (and for anyone who has a similar issues), this also happened on a Drupal 9 vanilla installation. The solution also works on D9. Thx.
    – Marv S
    Commented Jul 16, 2021 at 22:35

1 Answer 1

2

As per comments there were some leftover installed vendor files and removing composer.lock and the entire vendor folder and also web/modules/contrib/civicrm and then trying again clears it.

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.