I have run below commands with composer in Magento 2.3.1 and getting error like below.
composer config repositories.magento composer https://repo.magento.com
composer require magento/data-migration-tool:2.3.1
Get error
Fatal error: Uncaught TypeError: Return value of Magento\InventoryComposerInstaller\Plugin_composer_tmp0::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_tmp0->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(205): Composer\EventDispatcher\EventDispatcher->dispatchScript('pre-update-cmd', true)
#4 phar:///opt/cpanel/composer/bin/composer/src/Composer/Command/RequireCommand.php(20 in phar:///opt/cpanel/composer/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 69
Any solution on this.