10

i am trying to install the extension through composer but i am getting below error.

Your requirements could not be resolved to an installable set of packages.

Problem 1 - magento/composer-root-update-plugin is locked to version 1.0.0 and an update of this package was not requested. - magento/composer-root-update-plugin 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint. Problem 2 - dealerdirect/phpcodesniffer-composer-installer is locked to version v0.5.0 and an update of this package was not requested. - dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint. Problem 3 - laminas/laminas-dependency-plugin 1.0.4 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint. - magento/product-community-edition 2.4.0 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.4]. - magento/product-community-edition is locked to version 2.4.0 and an update of this package was not requested.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

For more information please find the below image. enter image description here

3 Answers 3

8

I was struggling with the same error recently. I downgraded Composer to 1.9 and deleted my composer.lock file, it resolved that error you are having.

Downgrade composer:

  1. Uninstall composer
  2. Follow the instructions here: https://getcomposer.org/download/ with the exception of using the download link for 1.9.3 (https://getcomposer.org/download/1.9.3/composer.phar)

Remove composer.lock file:

There is a file called composer.lock in your Magento root folder. Delete it or move it just in case.

Then just run the command you did before.

5
  • How can i downgraded composer and how to deletecomposer.lock-file Oct 28, 2020 at 7:03
  • I edited the answer
    – Kristoffer
    Oct 28, 2020 at 7:08
  • Thanks. I didn't download it directly, I added the version parameter instead to get 1.9.3 (php composer-setup.php --version=1.9.3).
    – mapetek
    Apr 6, 2021 at 9:27
  • Any solution for windows
    – Avesh Naik
    Jun 21, 2021 at 12:56
  • For the issue that I had, the secret was removing the composer.lock file
    – AboElnouR
    3 hours ago
14

It seems your are using unsupported composer version.

Check the current composer version with:

composer -V

The 1.0.0 version of magento/composer-root-update-plugin requires composer-plugin-api ^1.0, so it's not compatible with Composer2. You can check out repository in more detail here.

If you just recently updated the composer you can run a rollback

composer self-update --rollback

Or install the latest release of version 1:

composer self-update --1

If you are updating Magento please check out the official documentation.

Hope this helps!

1

I ran into similar issue during a Magento update 2.3.2 to 2.3.4 and found that composer 2 is only compatible with specific version of Magento 2 https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

I did update to the latest version of composer 1 by using command php composer-setup.php --version=1.10.22

This solved it for me.

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.