0

I am trying to update my Magento 2.3.0 installation to the latest version Magento 2.4.6 using Composer. However, when running the command:

composer require-commerce magento/product-community-edition 2.4.6 --no-update

I encounter the following error messages:

Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:879 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:884 Do not run Composer as root/super user! See https://getcomposer.org/root for details Continue as root/super user [yes]? yes

[Symfony\Component\Console\Exception\CommandNotFoundException] command "require-commerce" is not defined.

I am unsure what is causing this issue and how to fix it. Can someone please provide guidance on successfully updating Magento from version 2.3.0 to version 2.4.6 using Composer? Your help would be greatly appreciated.

Thank you!

2 Answers 2

1

If you still find issues regarding deprecated fucntionalities, you can fire "which php" in the console and you will see something like /usr/bin/php7.2

you may like below command then to be fired.

/usr/bin/php8.1 /usr/local/bin/composer require-commerce magento/product-community-edition 2.4.6 --no-update

If your composer's version is 1, fire below command to update it.

sudo composer self-update --2
0

composer require-commerce

require-commerce command is not a native command of Composer by default.

It will be available only after you install the Composer update plugin

So install the Composer Plugin based on your PHP version (assume you use PHP 7.3.x)

composer require magento/composer-root-update-plugin ~2.0 --no-update
 
composer update

After this you can proceed with the upgrade steps

composer require-commerce magento/product-community-edition 2.4.6 --no-update

Refer: Upgrade Magento2 / Adobe Commerce Open Source using Composer

1
  • I am using PHP 8.2.3 and Composer 2.2.0 and I am still facing this error after firing this command composer require magento/composer-root-update-plugin ~2.0 --no-update [InvalidArgumentException] Could not find a matching version of package magento/composer-root-update-plugin. Check the package spelling, your version constraint and that the package is avail able in a stability which matches your minimum-stability (dev). Jul 31 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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