drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

Cannot install with PHP 8.1 on a fresh Drupal 10 install

Open crtlf opened this issue 1 year ago • 5 comments

Problem/Motivation

Error on composer installation - requirements problems.

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

  Problem 1
    - drupal/console[v1.9.0, ..., 1.9.4] require php ^5.5.9 || ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
    - drupal/console[1.9.5, ..., 1.9.10] require composer/installers ~1.0 -> found composer/installers[v1.0.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.0).
    - Root composer.json requires drupal/console ^1.9 -> satisfiable by drupal/console[v1.9.0, ..., 1.9.10].

Details to include:

  • Drupal version : 10.0.0-rc2
  • PHP : 8.1.2

composer.json

{
    "name": "PROJECT_NAME",
    "description": "PROJECT_DESC",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^2.0",
        "drupal/core-composer-scaffold": "^10.0",
        "drupal/core-recommended": "^10.0",
        "drush/drush": "^11.3",
        "vlucas/phpdotenv": "^5.5"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "drupal/core-composer-scaffold": true,
            "phpstan/extension-installer": true,
            "dealerdirect/phpcodesniffer-composer-installer": true,
        },
        "sort-packages": true
    },
    "autoload": {
        "files": ["load.environment.php"]
    },
    "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"
            ]
        }
    }
}

How to reproduce

composer require drupal/console

crtlf avatar Dec 06 '22 17:12 crtlf

We need the PHP 8.1 support as well.

Thanks for your great work!!

faheemhameed avatar Dec 14 '22 22:12 faheemhameed

I will take a look

LOBsTerr avatar Dec 15 '22 14:12 LOBsTerr

Hi @LOBsTerr,

Is it possible to resolve this issue in near future? Sorry for pressure but I need to upgrade one project to Drupal 10 and PHP 8.1. And this is the only module blocking this...

thanks in advance best Dimon

DmitrySidorenkoShim avatar Jan 25 '23 09:01 DmitrySidorenkoShim

@DmitrySidorenkoShim

I understand this cannot be a solution, but if you are using Drupal Console essentially for generating controllers, modules, forms, etc... you can use the v11 of Drush that does the same.

https://www.drush.org/latest/commands/generate/

crtlf avatar Jan 25 '23 10:01 crtlf

@crtlf

thank you very much for the quick reply and for the suggestion yes, it make sense I will try it and I will remove "drupal/console" from project dependencies for now

I will still get notification if this issue will be resolved in future though

thanks Dimon

DmitrySidorenkoShim avatar Jan 25 '23 10:01 DmitrySidorenkoShim