1

I have a Drupal 8.6.7 project that I'm trying to manage with Composer. I'm trying to understand why I cannot make it work. To get this project started, I wiped the vendor and composer.lock file and ran composer install --with-dependencies Now I want to install a contributed module.

composer require drupal/workbench Composer returns the following:

Problem 1

- don't install drupal/core 8.6.7|remove drupal/drupal dev-master
- remove drupal/drupal dev-master|remove drupal/core 8.6.7
- don't install drupal/core 8.6.7|remove drupal/drupal dev-master
- Installation request for drupal/drupal dev-master -> satisfiable by drupal/drupal[dev-master].
- Installation request for drupal/core (locked at 8.6.7, required as ^8.6) -> satisfiable by drupal/core[8.6.7].

OK, there's something about drupal/core that's installed that is conflicting with this module. Except, the Composer output leaves me confused, as I have a working core 8.6.7. The composer tools are not in play at this point. composer why-not drupal/workbench and composer prohibit drupal/workbench fail because the module was never installed.

So I was looking through my composer.lock to figure out "remove drupal/drupal dev-master". What am I looking for? Not that I want to, but I need to figure this out and would like some help and the clues as to what Composer has installed is in the lock file. Going thermonuclear and reinstalling after manually adding this module in composer.json brings other issues.

My composer.json

{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
    "drupal/core": "^8.6",
    "composer/installers": "^1.0.24",
    "wikimedia/composer-merge-plugin": "^1.4",
    "drupal/address": "^1.4",
    "commerceguys/intl": "~0.7",
    "drush/drush": "^9.1.0",
    "drupal/ds": "^3",
    "drupal/menu_link_attributes": "^1.0",
    "drupal/redirect": "^1.0.0",
    "drupal/google_analytics": "^2.0.0",
    "drupal/console":"~1.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
    "preferred-install": "dist",
    "autoloader-suffix": "Drupal8"
},
"extra": {
    "merge-plugin": {
        "include": [
            "core/composer.json"
        ],
        "recurse": true,
        "replace": false,
        "merge-extra": false
    },
    "installer-paths": {
        "core": ["type:drupal-core"],
        "modules/contrib/{$name}": ["type:drupal-module"],
        "profiles/contrib/{$name}": ["type:drupal-profile"],
        "themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/contrib/{$name}": ["type:drupal-drush"],
        "modules/custom/{$name}": ["type:drupal-custom-module"],
        "themes/custom/{$name}": ["type:drupal-custom-theme"]
    }
},
"autoload": {
    "psr-4": {
        "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
    }
},
"scripts": {
    "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
    "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
    "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
    "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
    "drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
    "drupal-phpunit-upgrade": "@composer update phpunit/phpunit phpspec/prophecy symfony/yaml --with-dependencies --no-progress",
    "phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
    "phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [
    {
        "type": "composer",
        "url": "https://packages.drupal.org/8"
    }
]

}

  • did you try with composer require 'drupal/workbench:^1.1' ? – berramou Feb 4 at 22:44
  • Another wild guess: Your project with customized composer.json has the name drupal/drupal (just the first line of your composer.json). So in your case, drupal/drupal @dev-master is actually your own project. - I remember the composer templates for Drupal 8 even have a conflict "drupal/drupal": "*" line, which may add to your issue. Did you try with a custom project namespace as, e.g. sam/my_project? – Mario Steinitz Feb 4 at 23:21
  • 1
    I think this is more about this question What is the difference between drupal/drupal and drupal-composer/drupal-project packages? – 4k4 Feb 5 at 8:25
  • Thank you for your input. It is helping to shed light. Reading the link @4kr suggests that the "name" attribute s/b "drupal/core"? – sam452 Feb 6 at 14:10
  • @Mario Steinitz when you suggest a custom project namespace is new to me. Searching for that phrase did not shed light on how to do this to help isolate the issue? – sam452 Feb 6 at 14:12

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.