Composer fatal error

If you installed your project dependencies using Composer 1, you will most certainly see this issue while attempting to install new or update old project dependencies with Composer 2+.

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 /home/teamcity/2017.2.3/buildAgent/work/942ad3a15f527ecb/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11

  1. Make sure you have Composer 2+ installed. You can run composer self-update (outside of your project’s root) to upgrade it to composer 2+.
  2. Remove the composer.lock file: rm -rf vendor
  3. Remove the vendor directory: rm -f composer.lock
  4. Run composer update