composer / package-versions-deprecated

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

Updating to composer 2.2.1 replaced ocaramius package-version to 1.11.99 which causes this : Fatal error: Class PackageVersions\Installer contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) #32

Open Rituparna007 opened 2 years ago

Rituparna007 commented 2 years ago

Hello

I have upgraded composer version to 2.2.1 and PHP version is 7.3.29. After upgrading I am getting this error

Installing ocramius/package-versions (1.5.1): Extracting archive For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.

Fatal error: Class PackageVersions\Installer contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /var/www/book.grabrooms.com.dev.envoyer/releases/20211229142318/vendor/ocramius/package-versions/src/PackageVersions/Installer.php on line 32 PHP Fatal error: Class PackageVersions\Installer contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /var/www/book.grabrooms.com.dev.envoyer/releases/20211229142318/vendor/ocramius/package-versions/src/PackageVersions/Installer.php on line 32

Can you please guide me how can I solve this issue?

nicolas-grekas commented 2 years ago

can you run the command with --no-plugins and share the output of composer why ocramius/package-versions please? did you update Symfony deps also?

Rituparna007 commented 2 years ago

Output of composer why ocramius/package-versions

composer/package-versions-deprecated 1.11.99.4 replaces ocramius/package-versions (1.11.99) ocramius/package-versions 2.5.0 replaces composer/package-versions-deprecated (*)

Can you please tell me should I run composer update with --no-plugins? No I did not update Symfony deps.

Seldaek commented 2 years ago

Running composer update --no-plugins composer/package-versions-deprecated ocramius/package-versions should resolve it I'm hoping. The failure in OP is due to it installing 1.5.1 but that's a very old version I assume it came from your lock file?

Rituparna007 commented 2 years ago

Thanks for your response. I have applied the command you mentioned here. That's not working. Same error message is showing.

Process Output (Install Composer Dependencies)

Using global Composer installation. Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Package operations: 191 installs, 0 updates, 0 removals

Fatal error: Class PackageVersions\Installer contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /var/www/book.grabrooms.com.dev.envoyer/releases/20220103120144/vendor/ocramius/package-versions/src/PackageVersions/Installer.php on line 32 PHP Fatal error: Class PackageVersions\Installer contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /var/www/book.grabrooms.com.dev.envoyer/releases/20220103120144/vendor/ocramius/package-versions/src/PackageVersions/Installer.php on line 32

Yes it's getting from the lock file.

On Mon, Jan 3, 2022 at 5:19 PM Jordi Boggiano @.***> wrote:

Running composer update --no-plugins composer/package-versions-deprecated ocramius/package-versions should resolve it I'm hoping. The failure in OP is due to it installing 1.5.1 but that's a very old version I assume it came from your lock file?

— Reply to this email directly, view it on GitHub https://github.com/composer/package-versions-deprecated/issues/32#issuecomment-1004039403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJZWWYSYIR2HTQ3M7QYV5S3UUGEMRANCNFSM5K6FYMZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

--

https://www.linkedin.com/company/indus-net-technologies/ https://twitter.com/indusnettech https://www.instagram.com/indusnettech/ https://www.facebook.com/IndusNetTechnologies/

We are listening! Please share your Praise, Suggestion, or Complaint with the CEO's office. https://docs.google.com/forms/d/e/1FAIpQLSdpUPOfgehfdZJWEuTqL55NDj2posWhP30_zlhFVtb7Rj6CXw/viewform?usp=sf_link

[image: Mailtrack] https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& Sender notified by Mailtrack https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& 05/18/20, 02:09:33 PM

Seldaek commented 2 years ago

Can you run the update I mentioned above, then run composer why -t ocramius/package-versions and share the output? Also make sure you commit the updated lock file so your deploy uses latest.

It seems to use 1.5.1 because you use PHP 7.3, and ocramius/package-versions 1.6+ requires PHP 7.4 or more, but that's why composer/package-versions-deprecated should be installed instead as that supports php 7.0+.

Maybe you need to explicitly require it if nothing else does require it. e.g. composer require composer/package-versions-deprecated, but the best would be to identify why ocramius/package-versions is needed and get rid of that IMO.