Magento2: Magento 2.4.1 problem with Composer 2.0.4 - SOLVED JUST USE COMPOSER 1

Created on 1 Nov 2020  路  8Comments  路  Source: magento/magento2

Can't Install using:
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.1 .

It's giving me back these problems:

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

Problem 1
- Root composer.json requires magento/composer-root-update-plugin ~1.0 -> satisfiable by magento/composer-root-update-plugin[1.0.0].
- 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
- Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
- 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.0, ..., 1.0.4] require 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.1 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4].
- Root composer.json requires magento/product-community-edition 2.4.1 -> satisfiable by magento/product-community-edition[2.4.1].

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.


magento@kalxn:/var/www/html$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.1 .
Creating a "magento/project-community-edition=2.4.1" project at "./"
Installing magento/project-community-edition (2.4.1)

  • Installing magento/project-community-edition (2.4.1): Extracting archive
    Created project in /var/www/html/.
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires magento/composer-root-update-plugin ~1.0 -> satisfiable by magento/composer-root-update-plugin[1.0.0].
- 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
- Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
- 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.0, ..., 1.0.4] require 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.1 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4].
- Root composer.json requires magento/product-community-edition 2.4.1 -> satisfiable by magento/product-community-edition[2.4.1].

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.
magento@kalxn:/var/www/html$


Summary of the issue
Information on your environment VirtualBox 4GB 25GB Storage. ubuntu 20.04
Steps to reproduce
Expected and actual results be able to install Magento and be compatible with Composer 2. Composer.json is showing the need of Composer 1 plugins.
Please make sure that the issue is reprod

not-confirmed

Most helpful comment

Unfortunately, Magento 2 isn't compatible yet with Composer version 2.
You can downgrade composer to version 1 using for example composer selfupdate --1 and then you should be able to install Magento.

You can follow https://github.com/magento/community-features/issues/302 to see when Magento will become compatible with composer version 2

All 8 comments

Hi @kalxn. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


  • Join Magento Community Engineering Slack and ask your questions in #github channel.

    :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

At the moment magento not support composer 2
See here note very clear
https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html

Composer is required for developers who wish to contribute to the Magento 2 codebase or anyone who wishes to develop Magento extensions.

Magento does not support Composer 2.x.

Soon core team will update core for compatible with latest composer

Yes, I also have the problem, composer 2 update.

Magento needs to update the dependency

https://github.com/magento/magento2/blob/2.4-develop/composer.json

"laminas/laminas-dependency-plugin": "^1.0", to "laminas/laminas-dependency-plugin": "^2.0",

https://github.com/magento/magento-composer-installer/blob/master/composer.json

"composer-plugin-api": "^1.0" to "composer-plugin-api": "^2.0"

an alternative until then. Use composer 1.

wget https://github.com/composer/composer/releases/download/1.10.17/composer.phar

mv composer.phar /usr/local/bin/composer

chmod +x /usr/local/bin/composer

Unfortunately, Magento 2 isn't compatible yet with Composer version 2.
You can downgrade composer to version 1 using for example composer selfupdate --1 and then you should be able to install Magento.

You can follow https://github.com/magento/community-features/issues/302 to see when Magento will become compatible with composer version 2

Unfortunately, Magento 2 isn't compatible yet with Composer version 2.
You can downgrade composer to version 1 using for example composer selfupdate --1 and then you should be able to install Magento.

You can follow magento/community-features#302 to see when Magento will become compatible with composer version 2

If the case is, you are using composer for version 2 for other platform in same computer with composer.phar file solved this right?

I removed ~/.config/composer dir and solved.

At the moment magento not support composer 2
See here note very clear
https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html

Composer is required for developers who wish to contribute to the Magento 2 codebase or anyone who wishes to develop Magento extensions.

Magento does not support Composer 2.x.

Soon core team will update core for compatible with latest composer

The documentation is contradictory. If you look on the previous page (Installation Flow Diagram) you'll see:

  • If you are more technical and you are familiar with Composer, get a Magento Open Source or Magento Commerce metapackage.


    • If you want to contribute to the Magento Open Source codebase or customize the Magento application, clone the Magento 2 GitHub repository. (This method requires familiarity with both GitHub and Composer.)

I always advocated for using composer in production to manage everything.
Sorry for the (semi) off-topic here.

Was this page helpful?
0 / 5 - 0 ratings