Opens in a new tab

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.

4 comments

  • dercheffe

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

    Best regards
    Phil

  • Robert Taylor

    Thank you! I had to update harvesthq/chosen to 1.8 to get mine to update, but I appreciate you sharing the tip — saved me some time for sure.

Leave your comment

✦ WebWash Premium

Go deeper with Premium

Lifetime access to every premium course, the private member forum and member-only live streams.

16+ in-depth courses
Private member forum
Member-only live streams
Ad-free, forever
Get lifetime access · €99

One-time payment · plus VAT