2

I've installed Drupal 9.2.5 using Composer (version 2.1.8). I am trying to install CiviCRM 5.41.0. I followed the steps in the CiviCRM instructions for installation on Drupal 8/9 using Composer.

The first couple of goes I got an "Installation failed" message at the CiviCRM compilation step.

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

[RuntimeException] Subcommand @composer compile returned with error code 255

So I decided to install Civi again, but skipped the compile step and do that as a separate instance.

The installation completed.

I then ran composer to compile all and got the same error code 255. For the full trace, see below.

I previously installed CiviCRM 5.40.3 and Drupal 9.2.3 with no issue.

I have read the similar issue over here:Drupal 8/9 Compilation Install Error but I noted that a patch for that issue was applied four months ago.

Can someone please help. I am not a developer. Just a self-taught admin trying to install CiviCRM.

Thanks.

$ composer compile --all

Compiling additional files (For full details, use verbose "-v" mode.) Compile: Generate CCL wrapper functions Compile: Greenwich CSS (dist/bootstrap3.css)

@php -r 'require_once '''/home/sdarmnet/dev9-my.sdarm.org.au/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL::copy('''../../bower_components/select2/select2-bootstrap.css''', '''extern/select2/select2-bootstrap.scss''');'

@php -r 'require_once '''/home/sdarmnet/dev9-my.sdarm.org.au/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL_VAR]);'

Script @php -r 'require_once '''/home/sdarmnet/dev9-my.sdarm.org.au/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL_VAR]);' handling the shell-runner event returned with error code 255 [sdarmnet@s04ad dev9-my.sdarm.org.au]$ composer --version Composer version 2.1.8 2021-09-15 13:55:14```

2

OK. Looks like I am not the only one with this issue.

A newer version of scssphp (v.1.7) appears to be the culprit: https://lab.civicrm.org/dev/drupal/-/issues/164#note_65206

Patch applied to CiviCRM 5.42

https://github.com/civicrm/civicrm-core/tree/5.42

The tl;dr on lab.civicrm.org: If you're affected by this and need an immediate fix, run composer require' 'scssphp/scssphp:1.6'

I ended up removing 5.41 then tried again requiring civicrm 5.42. Installed and compiled without issue.

3
  • 1
    Yeh this was only an issue recently because of the scssphp upgrade got released. Patch has been merged into the 5.41 and 5.42 branches so if you wanted to use 5.41 with this patch you would have to specify the civicrm-core version to be 5.41-dev rather than 5.41.1
    – Seamus Lee
    Sep 17 at 7:28
  • Presumably everyone trying to install currently is going to be affected by this? Effectively stopping them from installing unless they happen to stumble on this post? I don't see this issue mentioned in the install docs.
    – Graham
    Sep 22 at 8:31
  • 5.41 is sorted out now but for 5.40 and earlier yes. The bigger problem now is how to prevent a similar thing in the future. Composer promises flexibility, but it also creates a situation where you can install the exact same versions of drupal+civi at 09:00, and then do it again at 09:30, on the same computer same environment, and end up with different installs. Upgrades are even more fun. You can do it on a staging site and then just pass around a .lock file so everyone has the same thing, but then you can get conflicts if someone has module X installed that conflicts.
    – Demerit
    Sep 23 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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