Drupal 8 - Composer issue - Not removing dependencies or requirement from composer.json

by Prestosaurus   Last Updated January 11, 2018 20:07 PM

Edit: updated to what I hope is a better title for this question

Drupal 8.4

I ran this command:

composer require drupal/module_name

Worked fine, then I ran this command:

composer remove drupal/module_name

The next time I went to run a config-sync import I got an error saying:

"The configuration cannot be imported because it failed validation for the following reasons: Configuration module_name.settings depends on the module_name extension that will not be installed after import."

I made sure to uninstall the module through Drupal admin panel first. This has happened with more than one module so does not seem module specific.

This happened with the Rules module and the Stripe module. I was able to re-install the Rules module with Composer and that resolved, but Composer will not re-install Stripe as it says there are files in existence. Stripe require is in my composer.json file.

Reading through the Composer documentation it reads “After ‘composer remove’ we take a look at the composer.json file, where we’ll see that the module_name line was removed for us.” But this does not seem true in my case.

Is there a better way to uninstall with Composer? Not sure why dependencies were not removed, and looking for a fix, thanks!

Tags : 8 composer


Related Questions


drush 7.3 is not working

Updated July 16, 2016 08:03 AM

Managing module library dependencies with composer

Updated January 11, 2017 08:03 AM

Strategy on running drupal-update

Updated April 22, 2016 08:03 AM


How do I update core with Composer?

Updated February 18, 2017 13:07 PM