I have a problem with deploy. I had a composer 2.0^ on vagrant but I made a downgrade to 1.6.0.
non-zero return code
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in
composer.json. You may be getting outdated dependencies. It is recommended
that you run `composer update` or `composer update <package name>`.
Your lock file does not contain a compatible set of packages. Please run
composer update.
Problem 1
- composer/installers is locked to version v1.6.0 and an update of this
package was not requested.
- composer/installers v1.6.0 requires composer-plugin-api ^1.0 -> found
composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- composer/installers v1.6.0 requires composer-plugin-api ^1.0 -> found
composer-plugin-api[2.0.0] but it does not match the constraint.
- soberwp/controller 2.1.1 requires composer/installers ^1.0 ->
satisfiable by composer/installers[v1.6.0].
- soberwp/controller is locked to version 2.1.1 and an update of this
package was not requested.
You are using Composer 2, which some of your plugins seem to be incompatible
with. Make sure you update your plugins or report a plugin-issue to ask them
to support Composer 2. (...)
When you want to stay with composer 1, you have to take into account that the composer lock file has been updated to dependencies that only work with composer 2. The easiest way would be just removing the composer lock file and installing again using composer 1 - I know, I know, a lockfile has a purpose, but usually it should just work this way, test the site afterwards.
If you want to use the new composer 2, you have to update your Bedrock site, as recent Bedrock uses composer dependencies that are compatible with composer 2. Create a new Bedrock project and then overwrite your existing project with these files, then resolve conflicts/merge the changes. Usually it is the composer.json that you have to merge as it contains your plugins and some meta data.
Thanks, I’ve updated composer to 2.0 and bedrock. That was a lot of changes in my environment. Downgrade python, update ansible, composer, bedrock + mismatch SSH keys… Crazy day
I have a similar problem, and as @Jacek I can’t update composer to 2.0.0.
@strarsis could you please articulate your msg for a not super expert user?
I would like to stay with composer 1, do I need to delete the /site/composer.lock and then from the /site/ directory run composer update.
(Assuming you are already using a VCS like git for your own Bedrock project) Copy all the files from the newly created Bedrock project (except vendor/) over your own Bedrock project, overwrite everything.
Using the VCS you can now resolve any conflicts and restore your own plugins and metadata (author and so on) in the composer.json.
Remove the existing composer.lock.
Install the composer dependencies and regenerate the composer.lock by invoking composer install.
Test the whole site, but usually it should just work. A common issue can be the filename case sensitivity sometimes (on native Windows file systems).
but reading your msg, I am wondering if this is a way to update bedrock?
I was thinking to update trellis and bedrock at one point today (even if I started this project just a couple of weeks ago, so they are not very out of date), but then I realised that I don’t know what it the best way to do this.
can I use this workflow to update bedrock some of my old trellis/bedrock websites?
Yes, you can update Bedrock (and Trellis). Though from there on you need to use the new composer 2 as composer 1 wouldn’t be compatible with the dependencies.
When you update Trellis you should test the new configuration on a staging server first.