Score:0

Cannot update Group module with composer

cn flag

We are using the Group module on our D8 site. We use composer to manage our modules and dependencies. I am somewhat of a composer novice, so it's possible that the solution is right in front of me, but I cannot see it.

The Group module refuses to be updated. It's currently at 1.0, and I'd like to update it to 1.4. I've tried running a simple composer update drupal/group, using --with-dependencies and --with-all-dependencies I've tried manually updating the composer.json to require both "1.4" and "^1.*". I've tried running the why-not command and all I get is "There is no installed package depending on "drupal/group" in versions not matching 1.4" Yet when I try to update the group module after changing the version in the composer file, all I get is the following.

$ composer update drupal/group --with-all-dependencies
Loading composer repositories with package information
Updating dependencies 
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package flow/jsonpath is abandoned, you should avoid using it. Use softcreatr/jsonpath instead.
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Generating autoload files 35 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

If I try to update using the version in the command, however I get the following.

$ composer update drupal/group:1.4
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Unable to find a compatible set of packages based on your non-dev requirements alone.
Your requirements can be resolved successfully when require-dev packages are present.
You may need to move packages from require-dev or some of their dependencies to require.

  Problem 1
    - Root composer.json requires drupal/group 1.*, 1.4, found drupal/group[1.0.0] but it does not match the constraint.

My composer.json is here, but I can't find anything that should be stopping this.

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 8 projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.2",
        "drupal/adaptivetheme": "^3.1",
        "drupal/address": "^1.8",
        "drupal/allowed_formats": "^1.3",
        "drupal/at_tools": "^3.2",
        "drupal/auto_entitylabel": "^3.0@beta",
        "drupal/better_exposed_filters": "^4.0@beta",
        "drupal/calendar": "^1.0-alpha2",
        "drupal/conditional_fields": "^4.0@alpha",
        "drupal/core-composer-scaffold": "^8.9",
        "drupal/core-project-message": "^8.9",
        "drupal/core-recommended": "^8.9.17",
        "drupal/cshs": "^3.0",
        "drupal/date_recur": "^2.0",
        "drupal/date_recur_modular": "^2.0",
        "drupal/ds": "^3.5",
        "drupal/emptyparagraphkiller": "^1.0@alpha",
        "drupal/encryption": "^1.0",
        "drupal/facets": "1.7",
        "drupal/facets_range_dropdowns": "^1.0@beta",
        "drupal/feeds": "^3.0@alpha",
        "drupal/feeds_ex": "^1.0@alpha",
        "drupal/feeds_tamper": "^2.0@beta",
        "drupal/field_group": "^3.0",
        "drupal/field_permissions": "^1.0@RC",
        "drupal/file_extractor": "^2.0",
        "drupal/flag": "^4.0@beta",
        "drupal/fullcalendar_view": "^2.6",
        "drupal/group": "1.*",
        "drupal/group_permissions": "1.0.0-alpha7",
        "drupal/honeypot": "^1.30",
        "drupal/image_widget_crop": "^2.2",
        "drupal/inline_entity_form": "^1.0@RC",
        "drupal/login_destination": "^1.0@alpha",
        "drupal/name": "^1.0@RC",
        "drupal/node_view_permissions": "^1.2",
        "drupal/optional_end_date": "^1.0",
        "drupal/pathauto": "^1.6",
        "drupal/publishcontent": "^1.2",
        "drupal/quick_node_clone": "^1.12",
        "drupal/redirect_after_login": "^2.5",
        "drupal/scheduler": "^1.1",
        "drupal/search_api": "1.x-dev",
        "drupal/search_api_attachments": "^1.0@beta",
        "drupal/search_api_solr": "^4.2",
        "drupal/search_autocomplete": "^1.1",
        "drupal/simplify": "^1.2",
        "drupal/smart_trim": "^1.2",
        "drupal/swiftmailer": "^2.0",
        "drupal/twig_tweak": "^2.7",
        "drupal/twigsuggest": "^1.0@beta",
        "drupal/userprotect": "^1.1",
        "drupal/verf": "^1.0@beta",
        "drupal/view_unpublished": "^1.0",
        "drupal/views_bulk_operations": "^3.9",
        "drupal/views_exposed_filter_blocks": "^1.1",
        "drupal/views_ical": "^1.0@alpha",
        "drupal/webform": "^5.8",
        "wikimedia/composer-merge-plugin": "^2.0"
    },
    "require-dev": {
        "drupal/devel": "^3.0.0-beta1",
        "drush/drush": "^10.3"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            },
            "file-mapping": {
                "[web-root]/.htaccess": false
            }
        },
        "installer-paths": {
            "web/core": ["type:drupal-core"],
            "web/libraries/{$name}": ["type:drupal-library"],
            "web/modules/contrib/{$name}": ["type:drupal-module"],
            "web/profiles/contrib/{$name}": ["type:drupal-profile"],
            "web/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/contrib/{$name}": ["type:drupal-drush"],
            "web/modules/custom/{$name}": ["type:drupal-custom-module"],
            "web/themes/custom/{$name}": ["type:drupal-custom-theme"]
        },
        "drupal-core-project-message": {
            "include-keys": ["homepage", "support"],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",

                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        },
        "merge-plugin": {
            "include": [
                "web/modules/contrib/webform/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "ignore-duplicates": false,
            "merge-dev": true,
            "merge-extra": false,
            "merge-extra-deep": false,
            "merge-scripts": false
        }
    }
}
Score:1
cn flag

When this happens I typically will do this:

rm -rf vendor
rm -rf web/modules/contrib
composer clearcache

Then run your command again...

composer require 'drupal/group:^1.4'
Travis avatar
cn flag
Thanks for your post. This seemed to PARTIALLY work. It does seem to have updated the Group code to 1.4, but I still get a message, `"Unable to find a compatible set of packages based on your non-dev requirements alone. Your requirements can be resolved successfully when require-dev packages are present. You may need to move packages from require-dev or some of their dependencies to require. Problem 1 - Root composer.json requires drupal/group ^1.4, found drupal/group[1.0.0] but it does not match the constraint."` I'm confused why there would still be a problem if it was a cache issue
Jaypan avatar
de flag
It wasn't a cache issue. You were requesting version `1.4`, which doesn't exist. The composer version would be `1.4.0`. The command Ryan gave you told you to get the version that STARTS with `1.4`, and therefore will find `1.4.0`. The carat (`^`) at the start tells the system 'STARTS WITH'.
Travis avatar
cn flag
@Jaypan OK. Now that I've updated the constraint to be ^1.4, would you be able to shed any light on why it's still giving the error in the comment above? Thanks for adding some clarification!
cn flag
I would update your version of composer2 to the latest and then run `composer update`. When I look this stuff up I see an [issue](https://github.com/composer/composer/issues/9842) from around Q1 2021.
Travis avatar
cn flag
I'm already using version 2.1.5 of composer (what reports to be the most recent). That's what it reports when I run `composer self-update` at least.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.