Cannot install on 10.2, it requires 'drupal/core ^9' when asset packagist is not added to composer.json

Created on 26 June 2024, 3 months ago

Problem/Motivation

After running 'composer require oomphinc/composer-installers-extender' I run "composer require 'drupal/blizz_table_field:^2.0'" and it returns:

Problem 1
    - drupal/blizz_table_field[2.0.0, ..., 2.0.2] require drupal/core ^9 -> found drupal/core[9.0.0, ..., 9.5.11] but the package is fixed to 10.2.6 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/blizz_table_field[2.0.3, ..., 2.0.8] require bower-asset/papaparse ^5.3 -> could not be found in any version, there may be a typo in the package name.
    - Root composer.json requires drupal/blizz_table_field ^2.0 -> satisfiable by drupal/blizz_table_field[2.0.0, ..., 2.0.8].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Steps to reproduce

Install composer require 'drupal/blizz_table_field:^2.0'

Proposed resolution

Make it installable for Drupal 10.

πŸ› Bug report
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡·πŸ‡΄Romania andreic

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @andreic
  • Status changed to Closed: works as designed 3 months ago
  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    The module itself requires Drupal 9, 10 or 11 in blizz_table_field.info.yml.

    I think the problem in your case is this line:

        - drupal/blizz_table_field[2.0.3, ..., 2.0.8] require bower-asset/papaparse ^5.3 -> could not be found in any version, there may be a typo in the package name.
    

    Now, because the latest Drupal 10 compatible packages cannot be installed for your because of this, composer tries older versions of the module which are not good for the site again because they are for Drupal 8 or 9 only, and you have Drupal 10, that's why it shows that those require 'drupal/core ^9' and can't be installed.

    The solution for you would be adding asset packagist manually to your composer.json to the repositories section like this:

        "repositories": {
            "drupal": {
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            },
            "assets": {
                "type": "composer",
                "url": "https://asset-packagist.org"
            }
        },
    

    And under the "extra" key, bower-asset and npm-asset folder needs to be set:

            "installer-paths": {
                "web/core": [
                    "type:drupal-core"
                ],
                "web/libraries/{$name}": [
                    "type:drupal-library",
                    "type:bower-asset",
                    "type:npm-asset"
                ],
                "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"
                ]
            },
            "installer-types": [
                "bower-asset",
                "npm-asset"
            ],
    

    Similarly, how the official docs mention this: https://www.drupal.org/docs/develop/using-composer/manage-dependencies#t... β†’

    I guess I should update the module install instructions that previous maintainers wrote with a much clearer step by step starting from drupal/recommended-project template.

    Please reopen the issue if this not fixes it for you.

  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    I updated the install instructions on the module page.

Production build 0.71.5 2024