What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi all, After upgrading to composer 2.x I am getting this issue: ```Your requirements could not be

UM9F81RCP
UM9F81RCP Posts: 516 🧑🏻‍🚀 - Cadet

Hi all,

After upgrading to composer 2.x I am getting this issue:

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

  Problem 1
    - sllh/composer-versions-check is locked to version v2.0.3 and an update of this package was not requested.
    - sllh/composer-versions-check v2.0.3 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - ocramius/package-versions 1.4.0 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - phpstan/phpstan 0.10.8 requires jean85/pretty-package-versions ^1.0.3 -> satisfiable by jean85/pretty-package-versions[1.2].
    - jean85/pretty-package-versions 1.2 requires ocramius/package-versions ^1.2.0 -> satisfiable by ocramius/package-versions[1.4.0].
    - phpstan/phpstan is locked to version 0.10.8 and an update of this package was not requested.

ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
If you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.0+.

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.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Any ideas?

Comments

  • what’s the php version you are running this against?

  • UM9F81RCP
    UM9F81RCP Posts: 516 🧑🏻‍🚀 - Cadet

    7.3.22

  • then the solution is in the error message 🙂

  • ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
    If you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.0+.
    
  • UM9F81RCP
    UM9F81RCP Posts: 516 🧑🏻‍🚀 - Cadet

    it is not an option to upgrade 😓

  • did you try the suggested alternative?

  • UM9F81RCP
    UM9F81RCP Posts: 516 🧑🏻‍🚀 - Cadet

    you mean using composer/package-versions-deprecated?

  • yes. not sure this would work, but that’s what composer suggest 🤷

  • UM9F81RCP
    UM9F81RCP Posts: 516 🧑🏻‍🚀 - Cadet

    I tried it… but it did not work