It should be possible to do any one of these:
Use CiviCRM 5.31+. The error message above suggests it is using 5.30.x, which has older metadata. (Compare: 5.31's composer.json vs 5.30's composer.json)
Stick to composer v1 for as long as you're using an older version of Civi.
composer self-update --1
In the future, after you switch to a newer version of ...
Depending on how your initial site set up was created you might need to take a more extreme option detailed below but hopefully the following will work:
If you want you can copy composer.json , composer.lock to a new directory (or local) and use issue composer installto check the below works this can be useful if you are having problems and need to remove ...
In practice it's as simple as doing a composer update for the most part - assuming you're configured "sensibly" - the RoundEarth setup makes (or at least made!) some assumptions re: versioning that are not helpful for upgrading. So here goes:
You should declare both civicrm-core and civicrm-drupal-8 in your composer json file. In the require section you ...
My experience with anything composer-ish seems to be:
Struggle with it for a while until the site becomes messed up beyond repair.
Restore from backup and struggle some more until it's messed up again.
Create a brand new install and then copy over the sites/default folder and .htaccess and such.
Replace the database with my backup.
Run the upgrades.
Drupal 8/CiviCRM has the composer-patches package already installed. So you can add a section to the "extra" element in composer.json called "patches", and list out the patch with a title and a URL (or path) to a .diff file. Here's an example where I add four patches to standard CiviCRM:
diff --git a/composer.json b/composer.json
index 453ff74..5827a69 ...
Sounds like perhaps you’re missing ->
But I do recommend you change how you install D8/CiviCRM to as described in here:
Downstream Git/Composer Issues
It turns out this compilation error is related to composer versions:
Using default composer version of 1.10 on Ubuntu 20.04 produces this fatal error.
Manually upgrading to composer 2.0 resolves this issue.
Problem appears to have been a newbie-to-Composer issue. Every time I ran various composer commands, I'm told it overwrites the .json files I've been furiously editing for four hours, putting back all the code I'm trying to kill? Charming. Had no idea.
Was also told that the way to do this is to fork the project and point my top-level composer.json at it ...