2

I have a store in Magento 2.x.x

I want to update Magento 2.3 to 2.4 but when I update it using the command:

composer require magento/product-community-edition=2.4.0 --no-update

I get the following errors:

Warning from repo.magento.com: Your Magento authentication keys are invalid. Please double-check your keys in your Marketplace account. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html
Warning from repo.magento.com: Your Magento authentication keys are invalid. Please double-check your keys in your Marketplace account. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html
Warning from repo.magento.com: Your Magento authentication keys are invalid. Please double-check your keys in your Marketplace account. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html
Invalid credentials for 'https://repo.magento.com/packages.json', aborting.
https://repo.magento.com could not be fully loaded, package information was loaded from the local cache and may be out of date

I have my keys but where to put these keys is an issue.

0

3 Answers 3

3

In Magento 2 root directory of the project rename auth.json.sample file to auth.json OR create auth.json file and add Keys mentioned below.

Format as follows below:-

{
    "http-basic": {
        "repo.magento.com": {
            "username": "<username>",
            "password": "<password>"
        }
    }
}

If the above solution not worked try the below one.

Add keys on system auth.json file path as follows below

vim /root/.composer/auth.json

For Magento 2 upgrade steps as follows --> https://wp.me/p4FAWA-6X

OR

https://magento.stackexchange.com/a/323229/85990

If you like the answer please give thumbs up.

0

the Magento keys should be added in a file called auth.json in the .composer folder (which is situated in the root folder of your magento project), the file content format is:

{
    "http-basic": {
        "repo.magento.com": {
            "username": "<user>",
            "password": "<pass>"
        }
    }
}

Replace <user> with the public key and <pass> with the private key.

0
0

Log into your Magento server and enter the following command

composer config --list | grep home

This will tell you where the composer home folder is configured i.e.

[home] /home/someuser/.composer

Add your correctly configured auth.json file to the composer home folder

/home/someuser/.composer/auth.json

If you want to change the composer home folder you can manually set the COMPOSER_HOME environment variable, this is best done before composer is installed...

export COMPOSER_HOME=/var/www/dev/.composer

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.