6

I am trying to upgrade to commerce enterprise edition 2.4.4 from 2.3.6 but it's failing with error:

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

Please check screenshot: enter image description here

If any idea, Please guide me. Thanks in Advance!! :)

4 Answers 4

4

EDIT:

This is a better solution. From the docs (which I missed the first time): https://devdocs.magento.com/guides/v2.4/comp-mgr/cli/cli-upgrade.html

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

Original answer:

Just use composer require instead of composer require-commerce. I came accross the same lines in the docs. I don't know why.

Using the other command runs successfully. I just did an upgrade couple of minutes ago with this approach.

5
  • Actually after upgrading to 2.4.4, it's not changed root composer.json file version. Still it was 2.3.6 before and it's changed only in require-dev{} tag. Any idea please. Apr 13, 2022 at 9:36
  • 1
    Do you mean the "version" tag in the root of the composer.json file? You can edit it yourself. My experience is that composer does not change it. When you see the right version in the backend, you can be sure it succeeded ;)
    – Akif
    Apr 13, 2022 at 9:38
  • 1
    okay, Thanks :) Apr 13, 2022 at 9:40
  • You can accept the answer if it is correct, so you help others.
    – Akif
    Apr 13, 2022 at 10:09
  • Please check the other answer by Marcin J Jul 22, 2022 at 20:30
10

Please try to run:

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

prior to

composer require-commerce magento/product-community-edition 2.4.4 --no-update
1
  • As mentioned, you must now update the composer-root-update-plugin first. See : experienceleague.adobe.com/docs/commerce-operations/… So now, the magento installation requires this composer-root-update-plugin: "The Composer plugin resolves changes that must be made to the root project composer.json file before updating to a new product requirement. The plugin partially automates the manual upgrade by identifying and helping you resolve dependency conflicts instead of requiring you to identify and fix them manually." Jul 22, 2022 at 20:33
1

Below points worked for me while upgrade to Magento 2.4.4 EE

 php bin/magento maintenance:enable

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

 composer update

take back up of composer.json

 composer require magento/product-enterprise-edition 2.4.4 --no-update

 composer update

Please run below commands after successful upgrade:

 php bin/magento cache:clean

 php bin/magento cache:flush

 php bin/magento setup:upgrade

 php bin/magento setup:static-content:deploy -f

 php bin/magento maintenance:disable

After setup:static-content:deploy -f command If you want to use setup:di:compile command you can do it but It might be throw some errors we can do it later.

Just for cross checking version upgraded or not, upgrade and deploy command is enough.

0

I also faced same error

 "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "magento/magento-composer-installer": false,
            "magento/inventory-composer-installer": false,
            "laminas/laminas-dependency-plugin": false,
            "dealerdirect/phpcodesniffer-composer-installer": false,
            "magento/composer-dependency-version-audit-plugin": false,
            "magento/composer-root-update-plugin": true
        }
    },

That was false here "magento/composer-root-update-plugin": true

Your Answer

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

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