3

I tried to install Magento 2.4 via command line. It runs smooth until

[Progress: 653 / 1206]
Module 'Magento_ComposerRootUpdatePlugin':

At this step the installation fails with

Installing data... Reading /<magento_root>/composer.json
Loading config file /<magento_root>/composer.json
Failed to initialize global composer: Composer could not find the config file: /<magento_root>/var/composer_home/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

Composer is installed globally. The Magento documentation does not mention anything else regarding composer.

Thank you very much.

14
  • Facing the Same Error Failed to initialize global composer: Composer could not find the config file: /Users/mac/sites/ewlicense/var/composer_home/composer.json To initialize a project, please create a composer.json file as described in the getcomposer.org "Getting Started" section I also tried composer self-update but it still not fixed the issue. the Url is giving me 502 Bag Gateway – Muhammmd Ahmad Anwar Aug 3 '20 at 13:27
  • I'm facing the same issue... – KaMZaTa Aug 4 '20 at 0:10
  • @hardy123480 Were you able to install Magento 2.4.0 even if it's shown this error? – KaMZaTa Aug 4 '20 at 12:52
  • 1
    Kind of. What I now tried is to install a local instance of composer in the Magnet root directory. It still throws the error but the installation goes through successfully. Unfortunately, I get 502 Bad Gateway if I want to access the frontend / backend. I'm running out of ideas. – hardy123480 Aug 4 '20 at 13:11
  • @hardy123480 which php version are you running? 7.4.8? – KaMZaTa Aug 4 '20 at 15:26
3

Here's a workaround - after creating the project from magento Repo, create the composer.json file

cd var
mkdir composer_home
cd composer_home
vim composer.json

composer.json contents-

{
}

Hope this works for you

3

I had the same problem. But it was solved by creating auth.json in var/composer_home like this

{ "http-basic": { "repo.magento.com": { "username": "your username key", "password": "your password key" } } }

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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