Update Chosen Module Via Composer in Drupal 8

I was tasked with the job of updating a Drupal site, as one often does when they work on Drupal sites. And I noticed that the Chosen module needed to be updated.

So I simply ran composer update drupal/chosen and nothing updated!

Then I ran composer require drupal/chosen. Which is what I do in composer update doesn’t work. But I got the following message:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/chosen_lib 2.8.0 requires drupal/chosen 2.8.0 -> satisfiable by drupal/chosen[2.8.0] but these conflict with your requirements or minimum-stability.
    - drupal/chosen_lib 2.8.0 requires drupal/chosen 2.8.0 -> satisfiable by drupal/chosen[2.8.0] but these conflict with your requirements or minimum-stability.
    - drupal/chosen_lib 2.8.0 requires drupal/chosen 2.8.0 -> satisfiable by drupal/chosen[2.8.0] but these conflict with your requirements or minimum-stability.
    - Installation request for drupal/chosen_lib (locked at 2.8.0) -> satisfiable by drupal/chosen_lib[2.8.0].


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

Solution

The solution is to run:

composer update drupal/chosen --with-dependencies

Take note of the --with-dependencies at the end of the composer command.

Hope this post saves someone an hour’s worth of debugging.

Ivan Zugec

About Ivan Zugec

Ivan is the founder of WebWash and spends most of his time consulting and writing about Drupal. He's been working with Drupal for 12 years and has successfully completed several large Drupal projects in Australia.

2 thoughts on “Update Chosen Module Via Composer in Drupal 8”

  1. At the solution code you wrote at the beginning “compose”, shouldn’t it mean “composer” instead?

    Best regards
    Phil

Leave a Comment

You have to agree to the comment policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Media Management in Drupal

Download a FREE 8 part video course on managing media in Drupal.