php – Conflict error during CakePHP 3.8.10 to 4.x upgrade-ThrowExceptions

Exception or error:

I want to upgrade the CakePHP framework behind our project. Currently we are using the 3.8.10 version.
I did all the steps to complete the process described here:
https://book.cakephp.org/4/en/appendices/4-0-upgrade-guide.html
(I have no, errors, warnings or notices in my code)

All the steps worked just fine but the last.

After i run the following command:

php composer.phar require --update-with-dependencies “cakephp/cakephp:4.0.*”

I receive the following error message:

Problem 1
- cakephp/bake 1.12.0 requires cakephp/cakephp ^3.8.0 -> satisfiable by cakephp/cakephp[3.8.0, 3.8.0-RC1, 3.8.0-RC2, 3.8.0-RC3, 3.8.0-beta1, 3.8.1, 3.8.10, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.x-dev] but these conflict with your requirements or minimum-stability.
- cakephp/bake 1.12.0 requires cakephp/cakephp ^3.8.0 -> satisfiable by cakephp/cakephp[3.8.0, 3.8.0-RC1, 3.8.0-RC2, 3.8.0-RC3, 3.8.0-beta1, 3.8.1, 3.8.10, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.x-dev] but these conflict with your requirements or minimum-stability.
- cakephp/bake 1.12.0 requires cakephp/cakephp ^3.8.0 -> satisfiable by cakephp/cakephp[3.8.0, 3.8.0-RC1, 3.8.0-RC2, 3.8.0-RC3, 3.8.0-beta1, 3.8.1, 3.8.10, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for cakephp/bake (locked at 1.12.0, required as ^1.9.0) -> satisfiable by cakephp/bake[1.12.0].

Can you help me identify the problem? What am I doing wrong?

How to solve:

Similar issue is already listed on Cakephp github repository

To resolve this you need to use "cakephp/bake": "4.x-dev"

OR

For the time being you also need to add the following settings to your composer.json until the migrations and twig-view plugins get new CakePHP 4 compatible stable releases:

"minimum-stability": "dev",
"prefer-stable": true

You can check the below links

https://github.com/cakephp/cakephp/issues/13114

https://github.com/cakephp/cakephp/issues/14043

https://github.com/cakephp/app/blob/4.0.0-alpha1/composer.json

Leave a Reply

Your email address will not be published. Required fields are marked *