Drupal core dependency error when updating to 2.1.0

Created on 15 September 2024, 3 months ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

It's impossible to update from 2.0.7 to 2.1.0 because of a dependency.

Barcodes 2.1.0 version shows: "Works with Drupal: ^10.3 || ^11" but it is not working:

$ composer require 'drupal/barcodes:^2.1' -W
./composer.json has been updated
Running composer update drupal/barcodes --with-all-dependencies
Gathering patches for root package.
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/barcodes ^2.1 -> satisfiable by drupal/barcodes[2.1.0].
    - drupal/barcodes 2.1.0 requires tecnickcom/tc-lib-barcode ^2.0 -> found tecnickcom/tc-lib-barcode[2.0.7, ..., 2.3.1] but it conflicts with your root composer.json require (^1).

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

Looking for the dependency origin:


$ composer why 'tecnickcom/tc-lib-barcode'
drupal/recommended-project -     requires tecnickcom/tc-lib-barcode (^1)
drupal/barcodes            2.0.7 requires tecnickcom/tc-lib-barcode (^1)

Steps to reproduce

Config:
- Drupal 10.3.5
- Barcodes 2.0.7
- PHP 8.3

Simply trying to update.

πŸ’¬ Support request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain Sistemas SUMADOS

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

Comments & Activities

  • Issue created by @Sistemas SUMADOS
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    drupal/barcodes 2.1.0 requires tecnickcom/tc-lib-barcode ^2.0
    This is true.
    drupal/recommended-project - requires tecnickcom/tc-lib-barcode (^1)
    Where is this requirement coming from?

    I have Barcodes 2.1.x installed on a Drupal 10.3 sites, so I know it works.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    I tried this on a clean 10.3 site:

    $ composer create-project drupal/recommended-project:^10.3 test-10-3
    $ cd test-10-3/
    $ composer require drupal/barcodes:2.0.7

    This worked, installed Barcoded 2.0.7

      - Locking drupal/barcodes (2.0.7)
      - Locking tecnickcom/tc-lib-barcode (1.18.4)
      - Locking tecnickcom/tc-lib-color (1.14.39)

    Then I tried:
    $ composer require drupal/barcodes:^2.1
    This failed, with the same error you showed.
    Then I tried:
    $ composer require drupal/barcodes:^2.1 -W
    This worked - this upgraded the tecnickcom/tc-lib-barcode library at the same time as it upgraded drupal/barcodes:

      - Upgrading drupal/barcodes (2.0.7 => 2.1.0)
      - Upgrading tecnickcom/tc-lib-barcode (1.18.4 => 2.3.1)
      - Upgrading tecnickcom/tc-lib-color (1.14.39 => 2.2.3)

    So I'm not sure why you are having a problem, unless you have something else installed that requires tecnickcom/tc-lib-barcode :^1

    If you leave off the -W, then it will fail like you observed, but when you tell composer to update with the dependencies then it really should be updating tecnickcom/tc-lib-barcode at the same time.

  • πŸ‡ͺπŸ‡ΈSpain Sistemas SUMADOS

    Thanks for your help. I finally find the problem. A very old manual edition of my composer.json

    It works with Drupal 10.3.5

  • Status changed to Closed: works as designed 3 months ago
Production build 0.71.5 2024