Problem/Motivation
When trying to install the module through composer in a Drupal 9.3.7 environment, the following error occurs:
Problem 1
- drupal/civicrm_group_roles dev-1.0.x requires drupal/core ~8.0 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev] but the package is fixed to 9.3.7 (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.
- drupal/civicrm_group_roles 1.0.x-dev is an alias of drupal/civicrm_group_roles dev-1.0.x and thus requires it to be installed too.
- Root composer.json requires drupal/civicrm_group_roles ^1.0 -> satisfiable by drupal/civicrm_group_roles[1.0.x-dev (alias of dev-1.0.x)].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
I believe this is because the module does not have a composer.json file. I've seen this issue before with other modules and adding the composer.json file generally resolves the issue.
Steps to reproduce
- Create a Drupal 9.3.7 project using composer (drupal/core-recommended:~9.3.0)
- Run
composer require drupal/civicrm_group_roles
Proposed resolution
Add a composer.json file.
Issue fork civicrm_group_roles-3268176
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
nickdjmI submitted a MR with the composer.json file added and it does indeed resolve the issue.
For anyone wanting to test this you can add an entry to the
repositoriessection in your composer file (above the packages.drupal entry):And then run
composer require drupal/civicrm_group_roles:dev-3268176-module-not-compatible.Edit: fixed the url for the repository
Comment #4
proteo commentedI had the same issue, because I thought the command posted in the module page was wrong:
$ composer require 'drupal/civicrm_group_roles-civicrm_group_roles:^1.0'So I changed
civicrm_group_roles-civicrm_group_rolestocivicrm_group_rolesand got the error. But to my surprise, running the suggested command works just fine.Comment #5
nubeli commented@NickDJM not sure how best to test it. I tried the composer require line you posted but got the error: "Root composer.json requires drupal/civicrm_group_roles dev-3268176-module-not-compatible, found drupal/civicrm_group_roles[dev-1.0.x, 1.0.x-dev (alias of dev-1.0.x)] but it does not match the constraint."
Thought this might work: lando composer require drupal/civicrm_group_roles-3268176:dev-3268176-module-not-compatible but also no.
At any rate the composer.json file looks fine. Need it to ensure the module can be installed properly.
Comment #7
matt-trim commented