Composer update failing with Root package 'magento/project-community-edition' cannot require itself in its composer.json

magento.stackexchange https://magento.stackexchange.com/questions/331239

  •  15-04-2021
  •  | 
  •  

Question

If I install a completely fresh version of Magento in an empty directory, say 2.3.3, using the command:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.4 .

Then Magneto installs fine. But if I then go to update this installation using

composer require magento/project-community-edition=2.3.4 --no-update

I get the error:

Root package 'magento/project-community-edition' cannot require itself in its composer.json

I've tried with multiple different versions of Magento, but I'm getting the same result.

The really odd thing is that this was working earlier today and has stopped working in the last couple of hours. The same thing happened yesterday. Working for some hours, then started getting the error and then when I returned to it this morning, everything working again.

I've tried on different servers and using different Magento Marketplace keys, but I'm getting the same result.

Was it helpful?

Solution

Idiotic mistake.

On the update, its should be magento/product-community-edition not magento/project-community-edition

I'm leaving this here because a similarly titled question (https://magento.stackexchange.com/questions/236766) had been deleted from this Stack, and it would have saved me a headache if they'd answered.

OTHER TIPS

Upgrade magento example version 2.4.2:

  • Step 1: Backup composer.json
    • cp composer.json composer.json.bk
  • Step 2: Preparing update: composer require magento/product-community-edition=2.4.2 --no-update
  • Finally :
  • composer update.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top