Answers.Body: <p>Add this line to the top level composer.json and then run <code>composer compile</code>:</p>
  <p><code>&quot;compile-whitelist&quot;: [&quot;civicrm/civicrm-core&quot;, &quot;civicrm/composer-compile-lib&quot;]</code></p>
  <p>Then it won't try to prompt you next time for upgrades either.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-01T22:04:34.543Z
Answers.Text: Being a dummy, I didn't know where to put the line of code, but the 3rd try worked...thanks!!! I put it near the end, before:
          "enable-patching": "true"
Answers.UserDisplayName: jimcrist
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-01T19:33:03.987Z
Answers.LastActivityDate: 2021-06-01T19:33:03.987Z
Answers.UserDisplayName: Demerit
Body: <p>I’m trying get CiviCRM working on a Drupal 9.1.9 test site. I know CiviCRM but not Drupal…
  I followed this: <a href="https://docs.civicrm.org/installation/en/latest/drupal8/" rel="nofollow noreferrer">https://docs.civicrm.org/installation/en/latest/drupal8/</a></p>
  <p>These are the commands I ran to install it:</p>
  <p>php composer.phar create-project drupal/recommended-project</p>
  <p>php composer.phar require pear/validate_finance_creditcard:dev-master</p>
  <p>php composer.phar config extra.enable-patching true</p>
  <p>php composer.phar require civicrm/civicrm-asset-plugin:'~1.1'</p>
  <p>php composer.phar require civicrm/civicrm-{core,packages,drupal-8}:'~5.37.2'</p>
  <p>The last command does a lot of installing and then gives me:</p>
  <p>[Exception]<br />
  Cannot prompt for compilation preferences. Please update COMPOSER_COMPILE, extra.compile-mode, or extra.compile-whitelist.</p>
  <p>compile [--all] [-N|--dry-run] [--soft-options [SOFT-OPTIONS]] [--] []...</p>
  <p>Subcommand @composer compile  returned with error code 1</p>
  <p>Installation failed, reverting ./composer.json and ./composer.lock to their original content.</p>
  <p>[RuntimeException]<br />
  Subcommand @composer compile  returned with error code 1</p>
  <p>Composer version 2.0.14 PHP 7.4.14</p>
  <p>Can someone please assist…thanks!</p>
  
Tags: <drupal-9>
Title: Drupal 9 Compilation Install Error
ThreadText: # Drupal 9 Compilation Install Error
  
  (Asked by: username_0 on 2021-06-01)
  
  I’m trying get CiviCRM working on a Drupal 9.1.9 test site. I know CiviCRM but not Drupal…
  I followed this: <https://docs.civicrm.org/installation/en/latest/drupal8/>
  
  These are the commands I ran to install it:
  
  php composer.phar create-project drupal/recommended-project
  
  php composer.phar require pear/validate\_finance\_creditcard:dev-master
  
  php composer.phar config extra.enable-patching true
  
  php composer.phar require civicrm/civicrm-asset-plugin:'~1.1'
  
  php composer.phar require civicrm/civicrm-{core,packages,drupal-8}:'~5.37.2'
  
  The last command does a lot of installing and then gives me:
  
  [Exception]  
  Cannot prompt for compilation preferences. Please update COMPOSER\_COMPILE, extra.compile-mode, or extra.compile-whitelist.
  
  compile [--all] [-N|--dry-run] [--soft-options [SOFT-OPTIONS]] [--] []...
  
  Subcommand @composer compile returned with error code 1
  
  Installation failed, reverting ./composer.json and ./composer.lock to their original content.
  
  [RuntimeException]  
  Subcommand @composer compile returned with error code 1
  
  Composer version 2.0.14 PHP 7.4.14
  
  Can someone please assist…thanks!
  
  **Tags:** drupal-9
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-06-01. Score: 1 | Accepted answer
  
  Add this line to the top level composer.json and then run `composer compile`:
  
  `"compile-whitelist": ["civicrm/civicrm-core", "civicrm/composer-compile-lib"]`
  
  Then it won't try to prompt you next time for upgrades either.
  
  > **Comments:**
  > **username_0**: Being a dummy, I didn't know where to put the line of code, but the 3rd try worked...thanks!!! I put it near the end, before:         "enable-patching": "true"  
  
  ---
  
  