Problem/Motivation

Having "version": "dev-master", is preventing the composer update or install by a composer.lock file

found drupal/block_library[dev-master] but it does not match the constraint.

Steps to reproduce

  • composer create-project
  • composer requiere drupal/block_library

Then any update or required other modules will bring the following

composer require 'drupal/block_library:^1.0@alpha'./composer.json has been updatedLoading composer repositories with package informationUpdating dependencies (including require-dev)Your requirements could not be resolved to an installable set of packages.

Problem 1- The requested package drupal/block_library ^1.0@alpha is satisfiable by drupal/block_library[dev-master] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

Proposed resolution

  • Remove "version": "dev-master", from the composer.json file

Remaining tasks

  • Patch
  • Test install
  • Test update
  • Test requiring other projects with block_library
  • Review

User interface changes

  • None

API changes

  • None

Data model changes

  • None
CommentFileSizeAuthor
#3 3205060-3.patch442 bytesrajab natshah
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

RajabNatshah created an issue. See original summary.

rajab natshah’s picture

Title: Fix issue with composer.lock on updates or install with composer.lock » Fix issue with composer.lock on updates or install with composer.lock with found drupal/block_library[dev-master] but it does not match the constraint
rajab natshah’s picture

StatusFileSize
new442 bytes
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Priority: Normal » Critical
Status: Active » Needs review
rajab natshah’s picture

Issue tags: +Composer 2.0, +composer.lock
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

cassioalmeida made their first commit to this issue’s fork.

cassioalmeida’s picture

I can confirm the issue.

When I export my configs after install and enable the https://www.drupal.org/project/ixm_blocks tabs, I got this in the dependencies:

 langcode: en
 status: true
 dependencies:
   module:
     - block_library
 third_party_settings:
   block_library:
     icon_path: modules/contrib/ixm_blocks/modules/ixm_blocks_tabs/images/ixm_blocks_tabs.svg
 _core:
   default_config_hash: 6ao9jVh7Yp3RCOvoHKrMNZwwceRnrgmiaAeY7mcODCY
 id: ixm_blocks_tabs
 label: Tabs
 revision: 0

As we can see, it depends on the block_library, but the ixm_blocks or ixm_tabs do not require it as a dependency.
So I started to have an issue with the config import because the module "block_library" does not exist.
Then I installed the block_library, I started to have this issue.

I'm using my MR https://git.drupalcode.org/project/block_library/-/merge_requests/2 and it fixed the problem.

aaronchristian’s picture

Looks good to me Cassio.

mahmoud-zayed’s picture

Status: Needs review » Fixed
mahmoud-zayed’s picture

Status: Fixed » Closed (fixed)

Add to 1.0.0-alpha2, thank you all!