Skip to content

Cannot install with PHP 8.1 on a fresh Drupal 10 install #4344

Open
@crtlf

Description

@crtlf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions