I wanted to upgrade the drupal core from version 10.1.4 to 10.1.6 with the command
composer update "drupal/core-*" --with-all-dependencies
from the VSCode terminal but it doesn't update and returns this to me
 

The "composer/installers" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.6.0"). You may need to run composer update with the "--no-plugins" option.
The "drupal/console-extend-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.6.0"). You may need to run composer update with the "--no-plugins" option.
Loading composer repositories with package information
Pattern "drupal/core-*" listed for update does not match any locked packages.
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
6 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

I did some research but I didn't understand where the error is

Comments

vm’s picture

a search of the error in google indicates that the site was built with composer 1.0 but the version of composer installed now is 2+

could also have to do with old json files or old directorys

https://www.drupal.org/project/upgrade_status/issues/3244151#:~:text=The....

Gae58’s picture

I wasted a lot of time on it and the solution was
Update to a specific version of core

jaypan’s picture

You will need to update Composer to version 2, in order to proceed.

Contact me to contract me for D7 -> D10/11 migrations.

Gae58’s picture

I ran the c omand
composer check-platform-reqs
Check platform requirements for packages in the vendor directory
composer-runtime-api 2.2.2 success
and the other calls are also a success

I ran composer self-update --2
It is already using the latest available version of Composer 2.6.5 (channel 2.x).

And it comes back to me that I am using version 2.
In any case if I update admin_toolbar to version 3.4.2.it returns me this error
composer require 'drupal/admin_toolbar:^3.4'
The "3.4" constraint for "drupal/admin_toolbar" appears too strict and probably does not match what you want. See https://getcomposer.org/constraints
./composer.json has been updated
Running composer update drupal/admin_toolbar
Loading composer repositories with package information
Updating dependencies
Could not resolve requirements in a set of installable packages.

  Problem 1.
    - The root composer.json file requires drupal/admin_toolbar, but could not be found in any version; there may be an error in the package name.

Potential causes:
 - A typo in the package name.
 - The package is not available in a sufficiently stable version, according to the minimum stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It is a private package and you forgot to add a custom repository to find it.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for additional common problems.

Installation failed, returning ./composer.json and ./composer.lock to their original contents.

I haven't figured out how to solve this problem

jaypan’s picture

Ok, then the next step is to update composer installers to version 2:

composer require composer/installers -W

Contact me to contract me for D7 -> D10/11 migrations.

Gae58’s picture

After running your command it returns me this error

composer require 'drupal/flexslider:^3.0@alpha'       
PHP Fatal error:  Declaration of Drupal\Console\Composer\Plugin\Installer::getLocationPattern($frameworkType) must be compatible with Composer\Installers\Installer::getLocationPattern(string $frameworkType): string in C:\Users\Gaetano\AppData\Roaming\Composer\vendor\drupal\console-extend-plugin\src\Installer.php on line 48

Fatal error: Declaration of Drupal\Console\Composer\Plugin\Installer::getLocationPattern($frameworkType) must be compatible with Composer\Installers\Installer::getLocationPattern(string $frameworkType): string in C:\Users\Gaetano\AppData\Roaming\Composer\vendor\drupal\console-extend-plugin\src\Installer.php on line 48
PS C:\xampp\htdocs\prove\web> composer update
PHP Fatal error:  Declaration of Drupal\Console\Composer\Plugin\Installer::getLocationPattern($frameworkType) must be compatible with Composer\Installers\Installer::getLocationPattern(string $frameworkType): string in C:\Users\Gaetano\AppData\Roaming\Composer\vendor\drupal\console-extend-plugin\src\Installer.php on line 48

Fatal error: Declaration of Drupal\Console\Composer\Plugin\Installer::getLocationPattern($frameworkType) must be compatible with Composer\Installers\Installer::getLocationPattern(string $frameworkType): string in C:\Users\Gaetano\AppData\Roaming\Composer\vendor\drupal\console-extend-plugin\src\Installer.php on line 48

I keep having problems when I perform upgrade or installation of modules.
Can you tell me how to uninstall and reinstall composer and if this can cause problems for existing projects locally ?

jaypan’s picture

It looks like you may have Drupal Console installed. As far as I know, it's been abandoned, as most features, if not all, have been implemented in Drush.

composer remove drupal/console

Contact me to contract me for D7 -> D10/11 migrations.

Gae58’s picture

Done what you recommended, the result is this

composer require 'drupal/flexslider:^3.0@alpha'     
./composer.json has been updated
Running composer update drupal/flexslider
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 drupal/flexslider, 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.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

ressa’s picture

Remove drupal/console-extend-plugin?

ressa’s picture

It would be much easier if you pasted in your composer.json file here.

Gae58’s picture

Contents of the local project json file

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^2.0",
        "drupal/admin_toolbar": "3.4.2",
        "drupal/core-composer-scaffold": "^10.1",
        "drupal/core-project-message": "^10.1",
        "drupal/core-recommended": "^10.1",
        "drupal/flexslider": "*",
        "drupal/devel": "^5.1",
        "drush/drush": "*"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "minimum-stability",
    "prefer-stable": true,
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "drupal/core-composer-scaffold": true,
            "drupal/core-project-message": true,
            "phpstan/extension-installer": true,
            "dealerdirect/phpcodesniffer-composer-installer": true
        },
        "sort-packages": true,
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-paths": {
            "web/core": [
                "type:drupal-core"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library"
            ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "web/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "web/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "web/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/installing-drupal",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    }
}

ressa’s picture

The command you run, and the resulting message would also help, as well as Operating System and PHP version.

ressa’s picture

Sorry, I see that you included it: composer update "drupal/core-*" --with-all-dependencies.

Gae58’s picture

Windows 10 pro
php 8.2.4

Yes the command I got it from drupal page for project update.
Did I get it wrong ?

ressa’s picture

With Composer version 2.5.8 and PHP 8.2.12, I updated these two lines, and everything works well with composer install and composer update "drupal/core-*" --with-all-dependencies after that:

   "minimum-stability": "alpha",

Removed a comma:

       "sort-packages": true