Score:-1

Why cannot I upgrade?

bv flag

I'm currently working on upgrading a Drupal site from Drupal 8.9.7 to Drupal 9.

I'm getting this error when I run lando composer require "drupal/core:^9.3.8" --with-all-dependencies.

Your requirements could not be resolved to an installable set of packages.

Problem 1

  • Root composer.json requires overtrue/phplint ^0.2.4 -> satisfiable by overtrue/phplint[0.2.4].
  • drupal/core-recommended[9.3.8, ..., 9.4.x-dev] require symfony/yaml v4.4.34 -> satisfiable by symfony/yaml[v4.4.34].
  • Conclusion: don't install symfony/yaml v4.4.34 (conflict analysis result)
  • Root composer.json requires drupal/core-recommended ^9.3.8 -> satisfiable by drupal/core-recommended[9.3.8, 9.3.x-dev, 9.4.x-dev].

Installation failed, reverting ./composer.json to its original content.

The content of the composer.json is the following.

{
    "name": "drupal-composer/drupal-project",
    "description": "Project template for Drupal 8 projects with composer",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "authors": [
        {
            "name": "",
            "role": ""
        }
    ],
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "php": ">=5.6",
        "composer/installers": "^1.7",
        "cweagans/composer-patches": "^1.7",
        "drupal/adminimal_admin_toolbar": "^1.9",
        "drupal/adminimal_theme": "^1.4",
        "drupal/bamboo_twig": "^5.0@alpha",
        "drupal/console": "^1.9.7",
        "drupal/core": "^9.3.8",
        "drupal/core-composer-scaffold": "^9.3.8",
        "drupal/core-project-message": "^9.3.8",
        "drupal/core-recommended": "^9.3.8",
        "drupal/ctools": "^3.7",
        "drupal/devel": "^4.1",
        "drupal/entity_reference_revisions": "^1.9",
        "drupal/google_analytics": "^3.0",
        "drupal/menu_trail_by_path": "^1.1",
        "drupal/page_manager": "^4.0@beta",
        "drupal/panels": "^4.3",
        "drupal/paragraphs": "^1.13",
        "drupal/smtp": "^1.0@beta",
        "drupal/twig_tweak": "^2.9",
        "drupal/video_embed_field": "^2.0",
        "drupal/webform": "^6.1",
        "drush/drush": "^9.0.0",
        "vlucas/phpdotenv": "^2.4",
        "webflo/drupal-finder": "^1.0.0",
        "webmozart/path-util": "^2.3"
    },

    "require-dev": {
        "behat/behat": "3.*",
        "behat/mink": "~1.7",
        "behat/mink-extension": "^2.2",
        "behat/mink-goutte-driver": "~1.2",
        "drupal/coder": "^8.2.12",
        "drupal/drupal-extension": "^3.1",
        "drush-ops/behat-drush-endpoint": "^0.0.4",
        "jcalderonzumba/gastonjs": "~1.0.2",
        "jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
        "mikey179/vfsstream": "~1.2",
        "overtrue/phplint": "^0.2.4",
        "squizlabs/php_codesniffer": "2.*",
        "symfony/css-selector": "^3.4.0"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true,
        "allow-plugins": {
            "composer/installers": true,
            "cweagans/composer-patches": true,
            "drupal/core-composer-scaffold": true,
            "drupal/console-extend-plugin": false,
            "zaporylie/composer-drupal-optimizations": false
        }
    },
    "autoload": {
        "classmap": [
            "scripts/composer/ScriptHandler.php"
        ],
        "files": ["load.environment.php"]
    },
    "scripts": {
        "pre-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "pre-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "post-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ],
        "post-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ]
    },
    "extra": {
        "composer-exit-on-patch-failure": true,
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "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/{$name}": ["type:drupal-drush"]
        },
        "drupal-scaffold": {
            "initial": {
                ".editorconfig": "../.editorconfig",
                ".gitattributes": "../.gitattributes"
            }
        }
    }
}

I'm really at a loss at this point any help would be appreciated.

id flag
It is not normal to depend on `drupal/core` itself in Composer, because it is included by `drupal/core-recommended`. That could be the issue.
bv flag
@cilefen I followed steps 1-3 here: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-later and now I get this error: Problem 1 - drupal/core-dev[9.0.0-alpha1, ..., 9.4.x-dev] require symfony/css-selector ^4.4 -> found symfony/css-selector[v4.4.0-BETA1, ..., 4.4.x-dev] but it conflicts with your root composer.json require (^3.4.0). - Root composer.json requires drupal/core-dev ^9 -> satisfiable by drupal/core-dev[9.0.0-alpha1, ..., 9.4.x-dev]. Updating to symfony/css-selector:^4.4 causes additional new errors.
id flag
Why are you installing Drupal/core-dev?
4uk4 avatar
cn flag
You can try for hours to repair the composer.json or simply download the current recommend Drupal 9 project and require the few extensions you have installed. Should take a few minutes to replace the codebase and you are ready to update the database.
bv flag
@4uk4 I'm thinking this might also be a great option seeing that it's not a massively complicated site.
Score:1
ua flag

but it conflicts with your root composer.json require (^3.4.0).

Yes, because ^ will never auto upgrade library to the next major version.

^3.4.0 is equivalent to saying >=3.4.0 < 4.0.0

So change it to "symfony/css-selector": "^4.0.0" in your composer.json

bv flag
Thank you for explaining the composer ... operators? to me a bit more. It's definitely helpful. I'll try this as well.
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.