0

When running composer install for fresh checkout of a project. (repo contains composer.lock that is working elsewhere) get the following error:

Plugin initialization failed (Plugin magento/inventory-composer-installer could not be initialized, class not found: Magento\InventoryComposerInstaller\Plugin), uninstalling plugin
  - Removing magento/inventory-composer-installer (1.2.0)
    Install of magento/inventory-composer-installer failed

                                                                                                                                    
  [UnexpectedValueException]                                                                                                        
  Plugin magento/inventory-composer-installer could not be initialized, class not found: Magento\InventoryComposerInstaller\Plugin  
                                                                                                                                    
  • this is using the same version of PHP where the lock file was generated
  • this is using the same version of composer where the lock file was generated
  • magento/product-community-edition: 2.4.3
  • I have tried with and without --no-dev
  • I have tried clearing the composer cache

I can replicate this 100% by either:

  • rm -rf vendor; composer install
  • rm -rf vendor/magento/inventory-composer-installer; composer install

When the class doesn't exist in vendor, because the composer hasn't installed it yet it just falls over.

0

The only workaround I have for this at the moment is to run

composer install --no-plugins

Which runs
Then following it up with

composer install

(to hopefully trigger the plugins)

Turns out this was actually a symptom of: https://github.com/magento/magento2/issues/34325

I had to regenerate the lockfile, after removing the audit plugin, as described here: https://github.com/magento/magento2/issues/34325#issuecomment-941937222

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.