【推荐】先把 composer.lock
删掉,再重新执行 composer require robmorgan/phinx
rm composer.lock
composer require robmorgan/phinx
手动降级包版本。由 3 降到 2 psr/log:^2
、psr/simple-cache:^2
命令:composer require psr/log:^2 psr/simple-cache:^2 robmorgan/phinx
这里是执行日志
➜ root@hecs /www/wwwroot/webman git:(master) ✗ composer require robmorgan/phinx
Using version ^0.12.10 for robmorgan/phinx
./composer.json has been updated
Running composer update robmorgan/phinx
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- cakephp/datasource[4.3.5, ..., 4.3.6] require psr/log ^1.0 || ^2.0 -> found psr/log[1.0.0, ..., 1.1.4, 2.0.0] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- cakephp/datasource[4.0.0, ..., 4.3.4] require psr/log ^1.1 -> found psr/log[1.1.0, ..., 1.1.4] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- robmorgan/phinx 0.12.10 requires cakephp/database ^4.0 -> satisfiable by cakephp/database[4.0.0, ..., 4.3.6].
- cakephp/database[4.0.0, ..., 4.3.6] require cakephp/datasource ^4.0 -> satisfiable by cakephp/datasource[4.0.0, ..., 4.3.6].
- Root composer.json requires robmorgan/phinx ^0.12.10 -> satisfiable by robmorgan/phinx[0.12.10].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require robmorgan/phinx:*" to figure out if any version is installable, or "composer require robmorgan/phinx:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
➜ root@hecs /www/wwwroot/webman git:(master) ✗
psr/log版本太高,被锁在3.0.0了,加个参数-W试下
加了无效噢,需要进行版本降级。我加在提问的解决部分了
你这样 先把composer.lock 删掉,再require,monolog里composer.json对psr/log的要求是1.0,2.0,3.0都可以
好,我试试
可以。删除后重新安装就能装了
谢谢
官方关闭的issue
大意就是psr/log v3需要cakephp5才支持,cakephp4不支持(spinx依赖cakephp4的datasource包)
嗯嗯。是这个原因。
datasource 依赖的版本还没升级,所以导致不能安装。早点休息吖。