Roots Discourse

Composer update/install issue with roots/wordpress-core-installer

I have no idea what to do with this error when trying to update:

  Problem 1
- roots/wordpress-core-installer dev-master requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- roots/wordpress-core-installer 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- roots/wordpress-core-installer 1.1.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- roots/wordpress 5.4 requires roots/wordpress-core-installer >=1.0.0 -> satisfiable by roots/wordpress-core-installer[1.1.0, 1.0.0, 9999999-dev (alias of dev-master)].
- Root composer.json requires roots/wordpress 5.4 -> satisfiable by roots/wordpress[5.4].

It then says:

You are using a snapshot build of Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report an issue to them to ask them to support Composer 2. To work around this you can run Composer with --ignore-platform-reqs, but this will also ignore your PHP version and may result in bigger problems down the line.

I should also say that it echos this before it tries to run the update:

The “roots/wordpress-core-installer” plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation (“2.0.0”). You may need to run composer update with the “–no-plugins” option.

I have tried the –no-plugins and –ignore-platform-reqs but it still doesn’t work.

2 Likes

I had the same problem after Composer installed the 2.0.0-dev version when running self-update. I ran that command again but this time specifying the latest stable version (1.10.5) and it fixed the problem.
That full command to fix was /usr/local/bin/composer self-update 1.10.5

Thank you @13milliseconds for you reply.

I tried the self update and now receive a different error…

[ErrorException]
Invalid argument supplied for foreach()

self-update [-r|–rollback] [–clean-backups] [–no-progress] [–update-keys] [–stable] [–preview] [–snapshot] [–1] [–2] [–set-channel-only] [–] []

I’ve searched around for this same error and found nothing relatable. :man_shrugging:

Maybe try re-installing the requirements?
ansible-galaxy install -r requirements.yml