We are having an ongoing project on OpenSocial, which is a profile based on Drupal 8. The project was installed using composer. However, later several modules were installed and updated via Drush.

Due to this, the composer file and the actual application is not in sync. What would be the best way to get out of this situation? Is there any way to fix composer?

  • 1
    Just audit the contrib modules you have installed, then composer require each. That will update composer.json and make sure the files are in sync and at latest version too – Clive Jun 7 '17 at 10:25
  • @Clive Thanks for the response. What do you mean, by checking files are in sync? I am not sure.. which files you are referring to. :/ – esafwan Jun 7 '17 at 21:22
  • I just mean it'll re-download the modules to make sure you have the most up-to-date – Clive Jun 7 '17 at 21:23

Try the Drush Composer Generate project. If you have your composer.json committed to a vcs, you can run composer-generate and then compare the results and fix up anything that it might mis-apply.

| improve this answer | |
  • As mentioned in my question, I am using Drupal 8 & the module you pointed out only have release for version 7. Is there any similar solution for D8? – esafwan Jun 8 '17 at 14:38
  • The above-mentioned project is a Drush extension, not a Drupal module. It works for Drupal 7 and Drupal 8 alike. The version numbering scheme required by drupal.org is deceptive for Drush extensions. Perhaps it would be clearer to host all of these on GitHub. – greg_1_anderson Jun 8 '17 at 18:49
  • Thanks a lot for the explaining the same. I was never aware of the same. – esafwan Jun 9 '17 at 11:14
  • So, how is that we know if a drush extension is actually D8 compatible. Will drush give a warning? – esafwan Jun 9 '17 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.