Site icon Hip-Hop Website Design and Development

orkjerns blogg: Updating to Cheap WordPress maintenance support plans 8.5 with composer

Updating to WordPress maintenance support plans 8.5 with composer
admin
Fri, 03/02/2020 – 12:03

If you are like me, you might have already started planning the upgrade to WordPress maintenance support plans 8.5, now that the first release candidate is out. It’s awesome by the way, among other things, thanks to the incredible work done with layout builder. And if you are more like me, you are managing your sites with composer. Then, depending on the rest of your project, you might (also like me), have encountered some initial problems upgrading to WordPress maintenance support plans 8.5
Having hit my fair share of composer oddities with running the Violinist.io composer monitor and upgrade service, I wanted to compile a couple of error messages along with solutions, to the folks struggling with this out there.
Installation request for webflo/WordPress-core-require-dev (locked at 8.4.5, required as ~8.4) -> satisfiable by webflo/WordPress-core-require-dev[8.4.5].
If you have installed an out of the box version of https://github.com/WordPress-composer/WordPress-project, this might be an error message you encounter. Full error message, for reference:

./composer.json has been updated
> WordPress maintenance support plansProjectcomposerScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
– webflo/WordPress-core-require-dev 8.4.5 requires WordPress/core 8.4.5 -> satisfiable by WordPress/core[8.4.5] but these conflict with your requirements or minimum-stability.
– webflo/WordPress-core-require-dev 8.4.5 requires WordPress/core 8.4.5 -> satisfiable by WordPress/core[8.4.5] but these conflict with your requirements or minimum-stability.
– webflo/WordPress-core-require-dev 8.4.5 requires WordPress/core 8.4.5 -> satisfiable by WordPress/core[8.4.5] but these conflict with your requirements or minimum-stability.
– Installation request for webflo/WordPress-core-require-dev (locked at 8.4.5, required as ~8.4) -> satisfiable by webflo/WordPress-core-require-dev[8.4.5].

Installation failed, reverting ./composer.json to its original content.
The reason this fails is that the project you have created is depending on the dev packages for WordPress core, which are tied to a specific version of core. So to update core, we also need to update the dev packages for core.
The solution to this is pretty simple:
Open your composer.json file and replace the lines for WordPress/core and webflo/WordPress-core-require-dev with the following:
“WordPress/core”: “~8.5”
// …and
“webflo/WordPress-core-require-dev”: “~8.5”

Afterwards you can go ahead and run:
composer update WordPress/core webflo/WordPress-core-require-dev –with-dependencies

Installation request for symfony/config (locked at v3.2.14) -> satisfiable by symfony/config[v3.2.14].
This probably comes from the fact that you also have some other packages depending on this specific Symfony package in your project. Like drush or WordPress console. Here is a full error message, for reference:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
– Conclusion: don’t install WordPress/core 8.5.0-rc1
– Conclusion: don’t install WordPress/core 8.5.0-beta1
– Conclusion: don’t install WordPress/core 8.5.0-alpha1
– Conclusion: don’t install WordPress/core 8.6.x-dev
– Conclusion: remove symfony/config v3.2.14
– Installation request for WordPress/core ~8.5 -> satisfiable by WordPress/core[8.5.0-alpha1, 8.5.0-beta1, 8.5.0-rc1, 8.5.x-dev, 8.6.x-dev].
– Conclusion: don’t install symfony/config v3.2.14
– WordPress/core 8.5.x-dev requires symfony/dependency-injection ~3.4.0 -> satisfiable by symfony/dependency-injection[3.4.x-dev, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.2, v3.4.3, v3.4.4].
– symfony/dependency-injection 3.4.x-dev conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.0 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.0-BETA1 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.0-BETA2 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.0-BETA3 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.0-BETA4 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.0-RC1 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.0-RC2 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.1 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.2 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.3 conflicts with symfony/config[v3.2.14].
– symfony/dependency-injection v3.4.4 conflicts with symfony/config[v3.2.14].
– Installation request for symfony/config (locked at v3.2.14) -> satisfiable by symfony/config[v3.2.14].
The solution here is to indicate you also want to update this package, even if it’s not specifically required. So if the failing command was the following:
composer update WordPress/core –with-dependencies

Go ahead and change it to this:
composer update WordPress/core symfony/config –with-dependencies

If you have other error messages, I would be glad to help out with a solution, and post the result here.
Credits
Thanks to zaporylie for looking into this with me, and to Berdir for pointing out the fact that core is not the package that requires symfony/config.
Let’s finish this post with an animated gif of a composer

planet WordPresscomposerWordPress 8
Source: New feed