Score:0

Why don't these Composer dependencies allow upgrading to Drupal 10?

cn flag

I'm currently on Drupal Version 9.5.10, and I cannot update to Drupal 10 due to some depdendancy conflicts.

I updated my database, cleared cache, ran a cron. It doesn't fix.

How can I upgrade to Drupal 10 ? I am currently on Drupal 9.5.10

[root@vlstage22 master]# 
[root@vlstage22 master]# composer require drupal/core-recommended:10.1.1 drupal/core-composer-scaffold:10.1.1 drupal/core-project-message:10.1.1 -W --ignore-platform-reqs
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? 
./composer.json has been updated
Running composer update drupal/core-recommended drupal/core-composer-scaffold drupal/core-project-message --with-all-dependencies
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/core-recommended 10.1.1 -> satisfiable by drupal/core-recommended[10.1.1].
    - drupal/core-recommended 10.1.1 requires drupal/core 10.1.1 -> found drupal/core[10.1.1] but these were not loaded, likely because it conflicts with another require.


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
[root@vlstage22 master]#

composer.json file

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 9 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": {
        "php": "^7.3||^8.0",
        "composer/installers": "^1.9",
        "drupal/admin_toolbar": "^3.4",
        "drupal/api": "^2.0@RC",
        "drupal/auto_entitylabel": "^3.0",
        "drupal/bootstrap": "^3.29",
        "drupal/core-composer-scaffold": "^10.0",
        "drupal/core-project-message": "^10.0",
        "drupal/core-recommended": "^10.0",
        "drupal/ctools": "^4.0",
        "drupal/devel": "^5.1",
        "drupal/diff": "^1.1",
        "drupal/encrypt": "^3.1",
        "drupal/entityreference_filter": "^1.4",
        "drupal/flood_control": "^2.3",
        "drupal/fpa": "^4.0",
        "drupal/masquerade": "^2.0@RC",
        "drupal/module_filter": "^4.0",
        "drupal/pathauto": "^1.11",
        "drupal/queue_ui": "^3.1",
        "drupal/search_api": "^1.29",
        "drupal/superfish": "^1.6",
        "drupal/token": "^1.12",
        "drupal/views_bulk_operations": "^4.2",
        "drupal/watchdog_prune": "^2.3",
        "drush/drush": "^11.6",
        "php-imap/php-imap": "^2.0",
        "symfony/finder": "^6.1"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "stable",
    "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/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "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"
            ]
        }
    }
}
Score:1
aq flag

Looks like the command you are running is composer require... that's incorrect you need to run composer update. Please see the docs they are very clear and easy to follow https://www.drupal.org/docs/updating-drupal/updating-drupal-core-via-composer

Score:0
id flag

I have taken this file and ran the same command. The full output is:

composer require drupal/core-recommended:10.1.1 drupal/core-composer-scaffold:10.1.1 drupal/core-project-message:10.1.1 -W --ignore-platform-reqs
./composer.json has been updated
Running composer update drupal/core-recommended drupal/core-composer-scaffold drupal/core-project-message --with-all-dependencies
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/core-recommended 10.1.1 -> satisfiable by drupal/core-recommended[10.1.1].
    - Root composer.json requires drupal/entityreference_filter ^1.4 -> satisfiable by drupal/entityreference_filter[1.4.0].
    - drupal/entityreference_filter 1.4.0 requires drupal/core ^8 || ^9 -> satisfiable by drupal/core[8.0.0, ..., 8.9.20, 9.0.0, ..., 9.5.10].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0, ..., 8.9.20, 9.0.0, ..., 9.5.10, 10.0.0, ..., 10.1.2].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.7.0, ..., 8.9.20, 9.0.0, ..., 9.5.10, 10.0.0, ..., 10.1.2].
    - drush/drush 11.6.0 conflicts with drupal/core 9.1.15.
    ...
    - drupal/core-recommended 10.1.1 requires drupal/core 10.1.1 -> satisfiable by drupal/core[10.1.1].
    - Root composer.json requires drush/drush ^11.6 -> satisfiable by drush/drush[11.6.0].

So the issue is:

drupal/entityreference_filter 1.4.0 requires drupal/core ^8 || ^9

drupal/entityreference_filter is not compatible with Drupal 10. You must remove it or use the beta version:

composer require drupal/core-recommended:10.1.1 drupal/core-composer-scaffold:10.1.1 drupal/core-project-message:10.1.1 'drupal/entityreference_filter:^2.0@beta'  -W --ignore-platform-reqs
id flag
Also I noticed your Composer command output is different than mine. You should upgrade Composer to the latest version.
Ali Rizvi avatar
cn flag
Problem 1 - Root composer.json requires drupal/core-recommended 10.1.1 -> satisfiable by drupal/core-recommended[10.1.1]. - drupal/core-recommended 10.1.1 requires psr/log ~3.0.0 -> found psr/log[3.0.0] but these were not loaded, likely because it conflicts with another require. Installation failed, reverting ./composer.json and ./composer.lock to their original content.
id flag
I do not know what you are trying to communicate with that comment.
Ali Rizvi avatar
cn flag
i tried this composer require drupal/core-recommended:10.1.1 drupal/core-composer-scaffold:10.1.1 drupal/core-project-message:10.1.1 'drupal/entityreference_filter:^2.0@beta' -W --ignore-platform-reqs
Ali Rizvi avatar
cn flag
but it gives this error Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires drupal/core-recommended 10.1.1 -> satisfiable by drupal/core-recommended[10.1.1]. - drupal/core-recommended 10.1.1 requires psr/log ~3.0.0 -> found psr/log[3.0.0] but these were not loaded, likely because it conflicts with another require.
id flag
What command gives that error? Did you change something? Did you upgrade Composer as I advised?
Ali Rizvi avatar
cn flag
my Composer version 2.5.5 2023-03-21 11:50:05
Ali Rizvi avatar
cn flag
this command gives that error :- composer require drupal/core-recommended:10.1.1 drupal/core-composer-scaffold:10.1.1 drupal/core-project-message:10.1.1 'drupal/entityreference_filter:^2.0@beta' -W --ignore-platform-reqs
id flag
It does not do so for me. Consider deleting the composer.lock file. What is the PHP version?
Ali Rizvi avatar
cn flag
PHP Version 8.1.18
Ali Rizvi avatar
cn flag
After deleting the composer.lock file able to migrate to drupal 10 thanx a lot for your help @cilefen
I sit in a Tesla and translated this thread with Ai:

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.