cancel
Showing results for 
Search instead for 
Did you mean: 

composer problem

composer problem

Hello,

I am using composer 1.10
Magento 2.4
PHP 7.4

when trying to require or to update I get

 

PHP Fatal error: Uncaught TypeError: Return value of Magento\InventoryComposerInstaller\Plugin::initModuleDeployment() must be an instance of Magento\InventoryComposerInstaller\void, none returned in /var/www/vhosts/meineapo.at/m24.meineapo.at/vendor/magento/inventory-composer-installer/src/Plugin.php:69
Stack trace:
#0 [internal function]: Magento\InventoryComposerInstaller\Plugin->initModuleDeployment(Object(Composer\Script\Event))
#1 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Composer\Script\Event))
#2 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
#3 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/Installer.php(208): Composer\EventDispatcher\EventDispatcher->dispatchScript('pre-update-cmd', true)
#4 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/Command/Update in /var/www/vhosts/meineapo.at/m24.meineapo.at/vendor/magento/inventory-composer-installer/src/Plugin.php on line 69

Fatal error: Uncaught TypeError: Return value of Magento\InventoryComposerInstaller\Plugin::initModuleDeployment() must be an instance of Magento\InventoryComposerInstaller\void, none returned in /var/www/vhosts/meineapo.at/m24.meineapo.at/vendor/magento/inventory-composer-installer/src/Plugin.php:69
Stack trace:
#0 [internal function]: Magento\InventoryComposerInstaller\Plugin->initModuleDeployment(Object(Composer\Script\Event))
#1 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Composer\Script\Event))
#2 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
#3 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/Installer.php(208): Composer\EventDispatcher\EventDispatcher->dispatchScript('pre-update-cmd', true)
#4 phar:///opt/psa/var/modules/composer/composer.phar/src/Composer/Command/Update in /var/www/vhosts/meineapo.at/m24.meineapo.at/vendor/magento/inventory-composer-installer/src/Plugin.php on line 69

 

Any idea?


Regards,
Gunther

7 REPLIES 7

Re: composer problem

@meineapo It seems like that you need to upgrade your composer version. 

For upgrade composer. You can follow this link

Hope, It maybe helpful for you.

 

Thanks

Re: composer problem

@meineapo 

 

I was also facing such kind of issues yesterday and it was related to composer.lock file issue foe me.

 

You can follow below steps:

It can be an issue of PHP versions. I will recommend you to check your HTTP requests and Command line PHP version.

 

OR

 

Clear composer cache and the update composer.

composer clearcache
composer update

 

OR

 

Remove the vendor directory and give another try to composer install

 

OR 

You can try by running below command:

 

Composer self-update 

 

PS: Keep backup before running any commands. Apart from that Magento 2.4 requires latest stable composer version as well. Thanks

Manish Mittal
https://www.manishmittal.com/

Re: composer problem

Compser is newest version, PHP is 2.4.

Which directory should I delete?

 

Regards,
Gunther

Re: composer problem

@meineapo Can you match the php version with the cli version, if both are same or not.

 

for this just run php -v on cli and check the version and create info.php file with the below code and run this file on browser and match the version there.

 

<?php

echo phpinfo();

Thanks

Re: composer problem

Both 7.4

 

Regards,
Gunther

Re: composer problem

OK, solution found: composer does not use php version from path...

Re: composer problem

Hi


May be i am late to reply this but hope below answer can help.


I had same issue i have fixed it by remove "void" from "endor/magento/inventory-composer-installer/src/Plugin.php" file. Assign return type to method is not compatible to your php version so either you can use " use void;" declaration at top or remove ": void" from method return type.