My Linux had a Composer upgrade to Composer version 2.1.9. No problem with the newly set up Drupal. Only I still have an older Drupal lying around, which I now also wanted to update Composer 2 and Drupal 9.
I have now oriented myself to the following documentation: https://www.drupal.org/docs/develop/using-composer/preparing-your-site-for-composer-2
With a "composer update –dry-run" I get the following error message:
The "composer/installers" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "cweagans/composer-patches" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "drupal/console-extend-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "drupal-composer/drupal-scaffold" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "zaporylie/composer-drupal-optimizations" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - drupal-composer/drupal-scaffold[2.5.0, ..., 2.6.1] require composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint. - Root composer.json requires drupal-composer/drupal-scaffold ^2.5 -> satisfiable by drupal-composer/drupal-scaffold[2.5.0, ..., 2.6.1].
And if I now do what the error message also says "composer update –no-plugins":
> DrupalProjectcomposerScriptHandler::checkComposerVersion Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - drupal-composer/drupal-scaffold[2.5.0, ..., 2.6.1] require composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint. - Root composer.json requires drupal-composer/drupal-scaffold ^2.5 -> satisfiable by drupal-composer/drupal-scaffold[2.5.0, ..., 2.6.1].
I can’t jump back to the old composer 1 version so easily at the moment unfortunately, can I just manually adjust the composer.json now and what do I have to consider. Would be grateful for any help!
My current but outdated composer.json:
{ "name": "drupal-composer/drupal-project", "description": "Project template for Drupal 8 projects with composer", "type": "project", "license": "GPL-2.0-or-later", "authors": [ { "name": "", "role": "" } ], "repositories": [ { "type": "composer", "url": "https://packages.drupal.org/8" } ], "require": { "php": ">=7.0.8", "behat/mink-selenium2-driver": "dev-master as 1.3.x-dev", "composer/installers": "^1.2", "cweagans/composer-patches": "^1.6.5", "drupal-composer/drupal-scaffold": "^2.5", "drupal/adminimal_admin_toolbar": "^1.10", "drupal/adminimal_theme": "^1.5", "drupal/aet": "2.x-dev@dev", "drupal/backup_migrate": "^4.0", "drupal/business_rules": "2.x-dev@dev", "drupal/ckeditor_accordion": "1.x-dev@dev", "drupal/ckeditor_font": "1.x-dev@dev", "drupal/commerce": "^2.16", "drupal/commerce_feeds": "^1.0@alpha", "drupal/console": "^1.0.2", "drupal/context": "4.x-dev", "drupal/core": "^8.7.0", "drupal/datatables": "1.x-dev", "drupal/devel": "^2.1", "drupal/diff": "^1.0", "drupal/ds": "^3.4", "drupal/entity_print": "2.x-dev", "drupal/entity_usage": "^2.0", "drupal/fancy_login": "^2.2", "drupal/feeds": "3.x-dev", "drupal/feeds_para_mapper": "1.x-dev", "drupal/feeds_tamper": "^2.0@beta", "drupal/field_group": "^3.0", "drupal/flag": "^4.0@alpha", "drupal/foundation_layouts": "^6.0", "drupal/go_back": "^1.5", "drupal/go_back_history": "^1.0", "drupal/inline_entity_form": "^1.0", "drupal/isbn": "^1.1", "drupal/libraries": "^3.0@alpha", "drupal/menu_token": "1.x-dev@dev", "drupal/module_filter": "^3.1", "drupal/node_token": "^1.1", "drupal/pagebreak": "^1.0", "drupal/paragraphs": "^1.12", "drupal/paragraphs_inline_entity_form": "^1.0@beta", "drupal/patchinfo": "^1.1", "drupal/pathauto": "^1.8", "drupal/php": "1.x-dev@dev", "drupal/printfriendly": "^3.4", "drupal/reference_table_formatter": "1.x-dev", "drupal/revision_log": "1.x-dev@dev", "drupal/revision_log_default": "^1.2", "drupal/rules": "3.x-dev@dev", "drupal/rules_ban": "^3.0@alpha", "drupal/rules_conditional": "1.x-dev@dev", "drupal/show_title": "^1.5", "drupal/super_login": "^1.3", "drupal/svg_image": "^1.15", "drupal/tablefield": "^2.1", "drupal/token": "^1.9", "drupal/token_custom": "^1.0@alpha", "drupal/token_filter": "1.x-dev@dev", "drupal/total_control": "^2.0@beta", "drupal/tr_rulez": "1.x-dev@dev", "drupal/vardumper": "^1.5", "drupal/vbo_export": "^3.1", "drupal/view_mode_page": "3.x-dev", "drupal/view_modes_display": "^2.2", "drupal/views_bulk_operations": "^3.3", "drupal/views_cumulative_field": "^1.5", "drupal/views_data_export": "1.x-dev", "drupal/views_simple_math_field": "2.x-dev@dev", "drupal/zurb_foundation": "^6.0", "drush/drush": "^9.0.0", "firephp/firephp-core": "^0.5.3", "mikehaertl/phpwkhtmltopdf": "~2.1", "phpoffice/phpexcel": "1.8.0", "phpoffice/phpspreadsheet": "^1.6", "phpoffice/phpword": "^0.17.0", "tecnickcom/tcpdf": "~6", "vlucas/phpdotenv": "^2.4", "webflo/drupal-finder": "^1.0.0", "webmozart/path-util": "^2.3", "zaporylie/composer-drupal-optimizations": "^1.0" }, "require-dev": { "webflo/drupal-core-require-dev": "^8.7.0" }, "conflict": { "drupal/drupal": "*" }, "minimum-stability": "dev", "prefer-stable": true, "config": { "sort-packages": true }, "autoload": { "classmap": [ "scripts/composer/ScriptHandler.php" ], "files": ["load.environment.php"] }, "scripts": { "pre-install-cmd": [ "DrupalProject\composer\ScriptHandler::checkComposerVersion" ], "pre-update-cmd": [ "DrupalProject\composer\ScriptHandler::checkComposerVersion" ], "post-install-cmd": [ "DrupalProject\composer\ScriptHandler::createRequiredFiles" ], "post-update-cmd": [ "DrupalProject\composer\ScriptHandler::createRequiredFiles" ] }, "extra": { "composer-exit-on-patch-failure": true, "patchLevel": { "drupal/core": "-p2" }, "installer-paths": { "web/core": ["type:drupal-core"], "web/libraries/{$name}": ["type:drupal-library"], "web/modules/contrib/{$name}": ["type:drupal-module"], "web/profiles/contrib/{$name}": ["type:drupal-profile"], "web/themes/contrib/{$name}": ["type:drupal-theme"], "drush/Commands/contrib/{$name}": ["type:drupal-drush"] }, "drupal-scaffold": { "initial": { ".editorconfig": "../.editorconfig", ".gitattributes": "../.gitattributes" } } } }
Greetings Bavra