cancel
Showing results for 
Search instead for 
Did you mean: 

Update Magento 2.3.4 to 2.4.x version, require.composer-root-update-plugin is invalid...

SOLVED

Update Magento 2.3.4 to 2.4.x version, require.composer-root-update-plugin is invalid...

Hello,

I'm experiencing an issue while executing commands on a Plesk server via plesk ssh terminal, in a magento site (/httpdocs).

 

I try to update magento 2.3.4 to 2.4.x version.

Commands:

composer require magento/composer-root-update-plugin=~1.0 --no-update
composer update
composer validate

In all cases, I'm getting the following error message:

In RootPackageLoader.php line 160:
require.composer-root-update-plugin is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -
, . or _. The complete name should match "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$".

I have checked the composer.json file and made sure that the syntax of the "require.composer-root-update-plugin" key is correct.

 

hosting server: plesk V18.0.52
php: 7.4
composer: v 2.5.8

composer.json file on /httpsdocs/

{
    "name": "msp/cashondelivery",
    "description": "",
    "require": {
        "php": "~7.3.0||~7.4.0||~8.0.0||~8.1.0||~8.2.0",
        "msp/common": "*",
        "magento/magento-composer-installer": "*",
		"magento/composer-root-update-plugin": "~1.0",
        "composer-root-update-plugin": "~2.0"
    },
    "suggest": {
    },
    "type": "magento2-module",
    "license": "OSL-3.0",
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "MSP\\CashOnDelivery\\": ""
        }
    },
    "config": {
        "allow-plugins": {
            "magento/magento-composer-installer": true
        }
    }
}

Even if I remove the "magento/composer-root-update-plugin": "~1.0" line from the composer.json file, i am still gives the same error, which makes me wonder if I'm in the right composer file.

 

I have locating composer.json files in:

/var/www/vhosts/mydomain.com/

/var/www/vhosts/mydomain.com/httpdocs

/var/www/vhosts/mydomain.com/.phpenv/shims

 

I try to understood if is a magento or plesk error

 

Could you please assist me in resolving this problem?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Update Magento 2.3.4 to 2.4.x version, require.composer-root-update-plugin is invalid...

Hello @Astergios 

 

  1. Verify the correct composer.json file: Make sure you are editing the correct composer.json file that belongs to your Magento project. Based on the paths you mentioned, the correct file should be located in /var/www/vhosts/mydomain.com/httpdocs.

  2. Remove the incorrect entry: In your composer.json file, remove the line "composer-root-update-plugin": "~2.0" from the require section. The correct key to include the magento/composer-root-update-plugin package should be "magento/composer-root-update-plugin": "~1.0". Once you have removed the incorrect entry, save the file.

  3. Update Composer: Ensure that you are using the latest version of Composer. Run the following command to update Composer to the latest version:

    composer self-update
  4. Run Composer commands: After making the necessary changes, try running the Composer commands again:

    composer require magento/composer-root-update-plugin=~1.0 --no-update
    composer update
    composer validate

If the issue persists after following these steps, you may need to investigate further by examining the full contents of your composer.json file, including any additional dependencies or customizations you have. Additionally, check for any conflicting or duplicated entries in the composer.json file.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

View solution in original post

1 REPLY 1

Re: Update Magento 2.3.4 to 2.4.x version, require.composer-root-update-plugin is invalid...

Hello @Astergios 

 

  1. Verify the correct composer.json file: Make sure you are editing the correct composer.json file that belongs to your Magento project. Based on the paths you mentioned, the correct file should be located in /var/www/vhosts/mydomain.com/httpdocs.

  2. Remove the incorrect entry: In your composer.json file, remove the line "composer-root-update-plugin": "~2.0" from the require section. The correct key to include the magento/composer-root-update-plugin package should be "magento/composer-root-update-plugin": "~1.0". Once you have removed the incorrect entry, save the file.

  3. Update Composer: Ensure that you are using the latest version of Composer. Run the following command to update Composer to the latest version:

    composer self-update
  4. Run Composer commands: After making the necessary changes, try running the Composer commands again:

    composer require magento/composer-root-update-plugin=~1.0 --no-update
    composer update
    composer validate

If the issue persists after following these steps, you may need to investigate further by examining the full contents of your composer.json file, including any additional dependencies or customizations you have. Additionally, check for any conflicting or duplicated entries in the composer.json file.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now