Answers.Body: <p>Although as of today (2020-11-20) there's no official word, I can see work being done towards this, e.g.</p>
  <p><a href="https://github.com/civicrm/composer-downloads-plugin/releases/tag/v3.0.0" rel="nofollow noreferrer">https://github.com/civicrm/composer-downloads-plugin/releases/tag/v3.0.0</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-20T20:11:08.550Z
Answers.LastActivityDate: 2020-11-20T20:11:08.550Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>It should be possible to do any one of these:</p>
  <ul>
  <li><p><strong>Use CiviCRM 5.31+</strong>. The error message above suggests it is using 5.30.x, which has older metadata. (Compare: <a href="https://github.com/civicrm/civicrm-core/blob/5.31/composer.json#L75" rel="noreferrer">5.31's composer.json</a> vs <a href="https://github.com/civicrm/civicrm-core/blob/5.30/composer.json#L74" rel="noreferrer">5.30's composer.json</a>)</p>
  </li>
  <li><p><strong>Stick to composer v1</strong> for as long as you're using an older version of Civi.</p>
  <pre><code>composer self-update --1
  </code></pre>
  <p>In the future, after you switch to a newer version of Civi (eg 5.31+), you can continue to composer v2:</p>
  <pre><code>composer self-update --2
  </code></pre>
  </li>
  <li><p><strong>Coerce the versions</strong>. Tell composer to install a new version of <code>composer-downloads-plugin</code> (v3.0.0 -- which supports composer v2) and pretend like it's an old version (v2.1.99 -- which is expected in <code>civicrm-core</code> v5.30). Command:</p>
  <pre><code>composer require 'civicrm/composer-downloads-plugin:v3.0.0 as v2.1.99'
  </code></pre>
  <p>In the future, after you switch to a newer version of Civi (eg 5.31+), you should edit <code>composer.json</code> and remove the coerced constraint. Otherwise, you may see weird behavior.</p>
  </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-24T20:54:51.593Z
Answers.LastActivityDate: 2020-11-24T21:01:50.153Z
Answers.LastEditDate: 2020-11-24T21:01:50.153Z
Answers.UserDisplayName: Tim Otten
Body: <p>Has anyone documented using Composer 2 with an install and/or upgrade of Drupal 8 + CiviCRM?</p>
  <p>I'm getting this error:</p>
  <pre><code>    - civicrm/composer-downloads-plugin[v2.0.0, ..., v2.1.1] require composer-plugin-api ^1.1 -&gt; found composer-plugin-api[2.0.0] but it does not match the constraint.
      - civicrm/civicrm-core 5.30.1 requires civicrm/composer-downloads-plugin ^2.0 -&gt; satisfiable by civicrm/composer-downloads-plugin[v2.0.0, v2.1.0, v2.1.1].
      - Root composer.json requires civicrm/civicrm-core 5.30.1 -&gt; satisfiable by civicrm/civicrm-core[5.30.1].
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-18T23:52:21.530Z
Comments.Text: It's come up in chat and for now the advice seems to be stick with 1.x.
Comments.UserDisplayName: Demerit
Tags: <drupal-8><composer>
Title: Install or upgrade CiviCRM using Composer 2?
ThreadText: # Install or upgrade CiviCRM using Composer 2?
  
  (Asked by: username_0 on 2020-11-18)
  
  Has anyone documented using Composer 2 with an install and/or upgrade of Drupal 8 + CiviCRM?
  I'm getting this error:
      - civicrm/composer-downloads-plugin[v2.0.0, ..., v2.1.1] require composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
      - civicrm/civicrm-core 5.30.1 requires civicrm/composer-downloads-plugin ^2.0 -> satisfiable by civicrm/composer-downloads-plugin[v2.0.0, v2.1.0, v2.1.1].
      - Root composer.json requires civicrm/civicrm-core 5.30.1 -> satisfiable by civicrm/civicrm-core[5.30.1].
  
  **Tags:** drupal-8, composer
  
  > **Comments:**
  > **username_1**: It's come up in chat and for now the advice seems to be stick with 1.x.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2020-11-24. Score: 5 | Accepted answer
  
  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 Civi (eg 5.31+), you can continue to composer v2:
  composer self-update --2
  
  
  Coerce the versions. Tell composer to install a new version of composer-downloads-plugin (v3.0.0 -- which supports composer v2) and pretend like it's an old version (v2.1.99 -- which is expected in civicrm-core v5.30). Command:
  composer require 'civicrm/composer-downloads-plugin:v3.0.0 as v2.1.99'
  
  In the future, after you switch to a newer version of Civi (eg 5.31+), you should edit composer.json and remove the coerced constraint. Otherwise, you may see weird behavior.
  
  
  ---
  
  ### Answer by username_0 on 2020-11-20. Score: 2
  
  Although as of today (2020-11-20) there's no official word, I can see work being done towards this, e.g.
  
  <https://github.com/civicrm/composer-downloads-plugin/releases/tag/v3.0.0>
  
  
  ---
  
  