0

I know the Composer Manager is deprecated, but I kept using it, because I didn't care. Now, on Drupal 8.2.5, running composer drupal-update doesn't work. It hits me in the face with a lot of errors like this:

don't install drupal/drupal 8.1.0|remove drupal/drupal dev-master

And I know that it's got to be something related to the version-guesser, and it doesn't know which core to install, or something irritating like this. I have tried a lot of modifications to the composer.json file, and I've tried some composer commands, which have all failed. I hate composer's error messages.

So, now I'm trying to just use composer to handle my module's dependencies, but when I use composer update or delete all vendor files and run composer install, it just gets the core updates. It doesn't get any of my module's dependencies. I can't rely on installing modules with composer alone because I have a lot of custom modules that need to download updates to their own dependencies, and I miss how Composer Manager would scan through my modules and update all of their composer.json files.

It seems like we're recommended to use the Composer Merge Plugin instead, but from what I see, that still doesn't really handle anything for you, unless you manually keep an updated file linking to all of your submodules' composer.json files. Is there a convenient way for me to do this, without writing my own script?

EDIT: Thanks to Berder's comment, I edited the main composer.json to include:

"merge-plugin": { "include": [ "core/composer.json", "modules/custom/*/composer.json" ],

And then composer update handles everything nicely.

(full error messages provided:)

> Drupal\composer_manager\Composer\Command::update
Loading composer repositories with package information
Updating dependencies (including require-dev)                                     
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install drupal/drupal 8.1.0|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.0-beta1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.0-beta2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.0-rc1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.10|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.3|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.4|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.5|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.6|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.7|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.8|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.9|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.x-dev|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-beta1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-beta2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-beta3|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-rc1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-rc2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.3|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.4|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.5|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.x-dev|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.3.x-dev|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.0|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.0-beta1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.0-beta2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.0-rc1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.10|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.3|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.4|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.5|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.6|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.7|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.8|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.9|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.1.x-dev|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-beta1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-beta2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-beta3|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-rc1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.0-rc2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.1|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.2|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.3|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.4|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.5|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.2.x-dev|remove drupal/drupal dev-master
    - don't install drupal/drupal 8.3.x-dev|remove drupal/drupal dev-master
    - Installation request for drupal/drupal dev-master -> satisfiable by drupal/drupal[dev-master].
    - Installation request for drupal/drupal ^8.1.0 -> satisfiable by drupal/drupal[8.1.0, 8.1.0-beta1, 8.1.0-beta2, 8.1.0-rc1, 8.1.1, 8.1.10, 8.1.2, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.1.7, 8.1.8, 8.1.9, 8.1.x-dev, 8.2.0, 8.2.0-beta1, 8.2.0-beta2, 8.2.0-beta3, 8.2.0-rc1, 8.2.0-rc2, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.2.x-dev, 8.3.x-dev].
  • 2
    Sounds like you have some sort of conflict, composer_manager hardcodes the old drupal-packagist repo, now that the official one on drupal.org is stable with different version scheme, there are modules that specific versions that might no longer work for you. composer_manager at this point is not much more than a wrapper around merge plugin. Not sure I see your problem, either you have re-usable custom modules, then put htem in their own repo and load them with composer or put the dependencies in the main composer.json. – Berdir Jan 16 '17 at 20:15
  • 2
    Even manually managing the merge plugin definitions is pretty ok when working with drupal-project because your composer.json is never automatically rewritten, it also supports wildcards, so you can do something like web/modules/custom/*/composer.json. That said, we can't really help if you don't at least post the complete error messages – Berdir Jan 16 '17 at 20:16
  • Incorrect, because you've already helped me! Thanks, Berdir, wildcards are wonderful. I only omitted the error messages because I thought people would think they were redundant. I'll post them in an edit. – RaisinBranCrunch Jan 16 '17 at 20:47
  • As it turned out, another developer had added a sandbox module which had the following required in the module's composer.json: "drupal/drupal": "^8.1.0" ...The error message does actually make a bit of sense now. I never thought a module would explicitly call for an old version of Drupal. – RaisinBranCrunch Jan 16 '17 at 21:53

Your Answer

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

Browse other questions tagged or ask your own question.