Ocramius / PackageVersions

:package: Composer addon to efficiently get installed packages' version numbers
MIT License
3.22k stars 67 forks source link

add composer 2.0 support #100

Closed glensc closed 5 years ago

glensc commented 5 years ago

with composer 2.0 the install is rejected:

$ composer install
The "ocramius/package-versions" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - ocramius/package-versions 1.4.0 requires composer-plugin-api ^1.0.0 -> no matching package found.
    - ocramius/package-versions 1.4.0 requires composer-plugin-api ^1.0.0 -> no matching package found.
    - Installation request for ocramius/package-versions 1.4.0 -> satisfiable by ocramius/package-versions[1.4.0].

to test:

git clone --depth=1 -b 2.0 https://github.com/composer/composer
(cd composer && composer install)
composer/bin/composer init -n
composer/bin/composer require ocramius/package-versions
Ocramius commented 5 years ago

That is correct: composer-plugin-api 1.0.0 is required.

glensc commented 5 years ago

so, no plans to support composer:2.0 anytime soon?

Ocramius commented 5 years ago

Once it's released, or at least once the composer-plugin-api is stable.

This problem applies to anything that is a plugin.

excennfahnfah1976 commented 3 years ago

Hoi, I'm getting this error when i try to update my application pakkages:

composer update
The "ocramius/package-versions" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.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

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

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.

excennfahnfah1976 commented 3 years ago

Is there a plan to upgrade to version 2?

Ocramius commented 3 years ago

This package already supports composer/composer:^2 in its newer released, but you do indeed need to upgrade to PHP 7.4+ first, since PHP 7.3 support has been dropped well over a year ago.

CoKhanh commented 3 years ago

@Ocramius I am using PHP 7.4.9 and composer 2.0.11 but i still get the same error?