As mentioned in the official magento 2 upgrade guide I installed magento/composer-root-update-plugin with the command:
composer require magento/composer-root-update-plugin ~2.0 --no-update
but when I run the command
composer update
it gives me this error:
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires magento/composer-root-update-plugin, it could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
How i can solve?
EDIT ———–
this is my composer.json:
{
"name": "magento/magento2ce",
"description": "Magento 2 (Open Source)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"laminas/laminas-dependency-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"magento/magento-composer-installer": true
}
},
"version": "2.4.3",
"require": {
"php": "~7.3.0||~7.4.0",
[...]
"magento/composer": "1.6.0",
"magento/composer-root-update-plugin": "~2.0",
"magento/magento-composer-installer": ">=0.1.11",
"magento/zendframework1": "~1.14.2",
[...]
},
[..]
"require-dev": {
[...]
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.0",
"pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": "^0.12.77",
"phpunit/phpunit": "^9",
"sebastian/phpcpd": "^6.0.3",
"squizlabs/php_codesniffer": "~3.5.4",
"symfony/finder": "^5.2"
}
[...]
}
My composer version is 2.5.5 and PHP version: 7.4.33 on Ubuntu 20.04.6 LTS
2
Answers
That package might be part of Magento’s own repository. Add it to your composer.json like this:
Have a look at their documentation if you have more questions about this repository
Try Your composer.json as below line , I solved this way