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!