Cannot install API 2.0.0 for Drupal 11.0.1 - conflict with symfony/yaml

Created on 20 August 2024, 3 months ago

Problem/Motivation

Installing API 2.0 on Drupal 11.0.1

Steps to reproduce

$ composer require 'drupal/api:^2.0'
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/api
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/api ^2.0 -> satisfiable by drupal/api[2.0.0].
    - drupal/api 2.0.0 requires symfony/yaml ^4.4.19 || ^6.2 -> found symfony/yaml[v4.4.19, ..., v4.4.45, v6.2.0, ..., v6.4.8] but it conflicts with your root composer.json require (^7.1).

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

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Other

Created by

🇮🇳India yasheshb

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

Comments & Activities

  • Issue created by @yasheshb
  • 🇪🇸Spain fjgarlin

    Does composer require 'drupal/api:2.x-dev@dev' work?

  • 🇮🇳India yasheshb

    @fjgarlin. does not work. thanks.

    i've upgraded from Drupal 11.0.1 to 11.0.4

    $ composer require 'drupal/api:2.x-dev@dev'
    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/api
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - drupal/api dev-2.x requires nikic/php-parser ^4.7 -> found nikic/php-parser[v4.7.0, ..., v4.19.2] but it conflicts with your root composer.json require (^5.2).
        - drupal/api 2.x-dev is an alias of drupal/api dev-2.x and thus requires it to be installed too.
        - Root composer.json requires drupal/api 2.x-dev@dev -> satisfiable by drupal/api[2.x-dev (alias of dev-2.x)].
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
    
    Installation failed, reverting ./composer.json and ./composer.lock to their original content.
    
  • 🇪🇸Spain fjgarlin

    And what if you tried the suggested -W option?

  • 🇮🇳India yasheshb

    thx. tried it. no luck.

    $ composer require 'drupal/api:^2.0' --dry-run -W
    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/api --with-all-dependencies
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires drupal/api ^2.0 -> satisfiable by drupal/api[2.0.0].
        - drupal/api 2.0.0 requires symfony/yaml ^4.4.19 || ^6.2 -> found symfony/yaml[v4.4.19, ..., v4.4.45, v6.2.0, ..., v6.4.12] but it conflicts with your root composer.json require (^7.1).
    
    
    Installation failed, reverting ./composer.json and ./composer.lock to their original content.
    
  • 🇪🇸Spain fjgarlin

    I just tried installing it via the demo installation script and it does work without issues with Drupal 11.0.4

    Demo folder + script: https://git.drupalcode.org/project/api/-/tree/2.x/demo

    $ ddev composer show | grep drupal
    ...
    drupal/api                               dev-2.x 27c5b55 Generates and displays API documentation pages
    drupal/core                              11.0.4          Drupal is an open source content management platform powering millions of websites and apply...
    ...
    

    I also tried with plain composer and again, it worked:

    composer create drupal/recommended-project
    composer require drush/drush
    composer require 'drupal/api:2.x-dev@dev' -W
    

    I committed a couple of minor changes to the demo script, but those weren't blocking.

    Can you paste all the commands that you are running from beginning to end so I can reproduce? Otherwise I recommend that you see the demo script which contains commands on how to set it all up.

Production build 0.71.5 2024