Hello!

Currently I'm trying to upgrade my Drupal 8.9.20 to Drupal 9 +. I have been following the steps in the article "How to upgrade from Drupal 8 to Drupal 9".

After some effort, upgrade_status module said my website is 100% ready for upgrading to Drupal 9.

However, after I ran the command

chmod 777 web/sites/default
chmod 666 web/sites/default/*settings.php
chmod 666 web/sites/default/*services.yml

composer require 'drupal/core-recommended:^9' 'drupal/core-composer-scaffold:^9' 'drupal/core-project-message:^9' --update-with-dependencies --no-update

composer update

I ran into an error message:

 Problem 1
    - Root composer.json requires drupal/autogrow ^1.0 -> satisfiable by drupal/autogrow[1.0.0, 1.x-dev].
    - Root composer.json requires drupal/core-recommended ^9 -> satisfiable by drupal/core-recommended[9.0.0-alpha1, ..., 9.5.x-dev].
    - composer/installers[v1.0.23, ..., v1.8.0] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.6.0] but it does not match the constraint.
    - drupal/autogrow[1.0.0, ..., 1.x-dev] require drupal/core ~8.0 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.x-dev].
    - drupal/core[8.0.0-beta13, ..., 8.0.0-beta15] require guzzlehttp/guzzle dev-master#1879fbe853b0c64d109e369c7aeff09849e62d1e -> found guzzlehttp/guzzle[dev-set-cookie-typing, dev-test, v1.0.3, v1.0.4, v2.0.0, ..., v2.8.8, v3.0.0, ..., v3.8.1, 4.0.0-rc.1, ..., 4.x-dev, 5.0.0, ..., 5.3.x-dev, 6.0.0, ..., 6.5.x-dev, 7.0.0-beta.1, ..., 7.9.x-dev, 8.0.x-dev] but it does not match the constraint.
    - drupal/core 8.0.0-beta6 requires doctrine/common dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5 -> found doctrine/common[dev-remove-int-cast, dev-3.4.x-merge-up-into-3.5.x_Nw2dYaQO, dev-3.4.x-merge-up-into-3.5.x_ERxP2qhI, 2.1.3, ..., 2.13.x-dev, 3.0.0, ..., 3.6.x-dev] but it does not match the constraint.
    - drupal/core-recommended 9.0.0-rc1 requires drupal/core 9.0.0-rc1 -> satisfiable by drupal/core[9.0.0-rc1].
    - drupal/core-recommended 9.0.0-alpha1 requires composer/installers v1.7.0 -> satisfiable by composer/installers[v1.7.0].
    - drupal/core-recommended[9.0.0-alpha2, ..., 9.0.0-beta2] require composer/installers v1.8.0 -> satisfiable by composer/installers[v1.8.0].
    - drupal/core-recommended 9.0.0-beta3 requires drupal/core 9.0.0-beta3 -> satisfiable by drupal/core[9.0.0-beta3].
    - drupal/core-recommended 9.0.0 requires drupal/core 9.0.0 -> satisfiable by drupal/core[9.0.0].
    - drupal/core-recommended 9.0.1 requires drupal/core 9.0.1 -> satisfiable by drupal/core[9.0.1].
...

For fixing this, I tired to uninstall Autogrow module via UI and ran `drush cr`, I also replace the line `"composer/installers": "^1.9"` to `"composer/installers": "^1.0 || ^2.0"`.  But this effort didn't change anything, the error message was still the same.

I'm aware that I need composer 1 to upgrade composer/installers, but when I roll back to composer 1 then try `composer require composer/installers:^1.9`, it gave me:

[ErrorException]
  Illegal string offset 'versions'

May I ask how should I fix this comflict error? 

Any help will be highly appreciated, thank you so much!

P.S. here is my composer.json file:

{
    "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"
        },
        {
        "type": "path",
    "url": "web/modules/contrib/autogrow",
    "options": {
      "symlink": true
    }
  }

    ],
    "require": {
        "composer/installers": "^1.0 || ^2.0",
        "drupal/adminimal_theme": "^1.6",
        "drupal/autogrow": "^1.0",
        "drupal/backup_migrate": "^5.0",
        "drupal/bootstrap": "^3.23",
        "drupal/bootstrap_barrio": "^5.5",
        "drupal/captcha": "^1.5",
        "drupal/ckeditor_entity_link": "^1.3",
        "drupal/cms_content_sync": "^2.2",
        "drupal/context": "^4.1",
        "drupal/context_active_trail": "^2.0@RC",
        "drupal/core-composer-scaffold": "^9",
        "drupal/core-project-message": "^9",
        "drupal/core-recommended": "^9",
        "drupal/ctools": "^3.7",
        "drupal/diba_carousel": "^1.15",
        "drupal/entity_reference_revisions": "^1.9",
        "drupal/feeds": "^3.0@alpha",
        "drupal/field_time": "^1.0@beta",
        "drupal/jquery_ui": "^1.3",
        "drupal/jquery_ui_accordion": "^1.1",
        "drupal/paragraphs": "^1.13",
        "drupal/scheduler": "^2.2",
        "drupal/search_exclude": "2.0.x-dev@dev",
        "drupal/simple_megamenu": "^1.1",
        "drupal/time_range": "^2.0",
        "drupal/upgrade_rector": "^1.0@alpha",
        "drupal/upgrade_status": "^3.19",
        "drupal/views_data_export": "^1.1",
        "drupal/views_infinite_scroll": "^1.9",
        "drupal/viewsreference": "^1.8",
        "drupal/webform": "^6.1",
        "drush/drush": "^10.6"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true,
        "allow-plugins": {
            "composer/installers": true,
            "drupal/core-composer-scaffold": true,
            "drupal/core-project-message": true
        }
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "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"
            ]
        }
    },
    "require-dev": {
        "drupal/core-dev": "^9"
    }
}

Comments

ressa’s picture

That composer.json file looks fine. I removed these parts, and ddev composer update completed:

,
        {
        "type": "path",
    "url": "web/modules/contrib/autogrow",
    "options": {
      "symlink": true
    }
  }

...and this:

        "drupal/autogrow": "^1.0",

Also, please note the difference between downloading and installing:

  • Composer = download
  • Extension system = install ("Extend" at/admin/modules or with Drush)