I got an error when composer install (PHP Fatal error: Class UpdateHelper \ ComposerPlugin contains 2 \ methods and must therefore be declared abstract or implement the remaining methods)

Conclusion first

Let's self-update and retry with composer 1.x system.

composer self-update --1

Details

Error after composer install

Environment is php7.3 series

$ php -d allow_url_fopen=1 /usr/bin/composer install
PHP Fatal error:  Class UpdateHelper\ComposerPlugin contains 2 \ methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /var/www/html/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11

Fatal error: Class UpdateHelper\ComposerPlugin 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/html/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11

Googling with the error name.

Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods · Issue #7 · kylekatarnls/update-helper https://github.com/kylekatarnls/update-helper/issues/7

Is it fixed with composer 2.x system? Try out.

composer2.x

Composer 2.0 is now available! https://blog.packagist.com/composer-2-0-is-now-available/

composer self-update

composer -V
Composer version 2.0.3 2020-10-28 15:50:55

I was able to update.

Same error when composer install again

A feeling of korejanai. This is the article I found by googled again.

Composer dump-autoload or update results in fatal error on Laravel 5.5 - Stack Overflow https://stackoverflow.com/questions/61236961/composer-dump-autoload-or-update-results-in-fatal-error-on-laravel-5-5

I just found a solution to this problem. Here it is for those who have the same problem.

I have had to delete the directory located inside my directory then run and after that. kylekatarnls vendor composer update -- prefer-source composer dump-autoload

Now all is working just fine.

(google translate) I just found a solution to this problem. Here it is for those who have the same problem.

I had to delete the directory inside my directory and run it and then. kylekatarnls vendor composer update --prefer-source composer dump-autoload

Now everything is going well.

So, save the kylektarnls directory under vendor and execute it again.

Another error with composer install

It's no good. I need to update to a library that supports Composer 2. I didn't intend to update the library so much, so I went back to composer 1.x and tried again.

$ php -d allow_url_fopen=1 /usr/bin/composer install
The "symfony/thanks" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - symfony/thanks is locked to version v1.2.4 and an update of this package was not requested.
    - symfony/thanks v1.2.4 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

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.
(google translate: I'm using Composer2, which seems to be incompatible with some plugins. Please update the plugin or report a plugin issue and ask for Composer 2 support.)

Retry to composer 1.x and OK

Composer 2.0 is now available! https://blog.packagist.com/composer-2-0-is-now-available/

The downgrade method to 1 system was also mentioned above.

composer self-update --1

# composer -V
Composer version 1.10.16 2020-10-24 09:55:59

When I did composer install again, the error disappeared.

As long as it is helpful.

Recommended Posts

I got an error when composer install (PHP Fatal error: Class UpdateHelper \ ComposerPlugin contains 2 \ methods and must therefore be declared abstract or implement the remaining methods)
I got an error when using nextInt, nextLine and substring.