Magento – Magento 2.3.1 Composer Fatal error when installing Ext

composerextensionsfatal errormagento2

Trying to install anything on Magento 2.3.0 & 2.3.1 using Composer I get the following error.

Does anyone know how to fix this?

Fatal error: Uncaught TypeError: Return value of Magento\InventoryComposerInstaller\Plugin_composer_tmp1::initModuleDeployment() must be an instance of Magento\InventoryComposerInstaller\void, none returned in phar:///opt/cpanel/composer/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code:69 Stack trace:

0 [internal function]: Magento\InventoryComposerInstaller\Plugin_composer_tmp1->initModuleDeployment(Object(Composer\Script\Event))
1 phar:///opt/cpanel/composer/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(176): call_user_func(Array, Object(Composer\Script\Event))
2 phar:///opt/cpanel/composer/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
3 phar:///opt/cpanel/composer/bin/composer/src/Composer/Installer.php(204): Composer\EventDispatcher\EventDispatcher->dispatchScript('pre-update-cmd', true)
4 phar:///opt/cpanel/composer/bin/composer/src/Composer/Command/RequireCommand.php(18 in phar:///opt/cpanel/composer/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 69

Best Answer

Check your PHP versions (CLI and Server) are compatible with the Magento 2.3 requirements

See the docs for the system requirements: https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html#php


The following PHP versions were specified in another thread for the same/similar issue on Stackoverflow

For Magento 2.3 : PHP 7.1

For Magento 2.2 : PHP 7.1 or PHP 7.0

For Magento 2.1 : PHP 7.1, PHP 7.0 or PHP 5.6

For Magento 2.0 : PHP 7.0, PHP 5.6 or PHP 5.5

Link to the StackOverflow thread: https://stackoverflow.com/questions/54867654/uncaught-typeerror-return-value-of-magento-inventorycomposerinstaller-must-be-a

Related Topic