无法安装 phinx 吗

= - =

解决方案

  1. 【推荐】先把 composer.lock 删掉,再重新执行 composer require robmorgan/phinx

    rm composer.lock
    composer require robmorgan/phinx
  2. 手动降级包版本。由 3 降到 2 psr/log:^2psr/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) ✗
1796 1 0
1个回答

nitron

psr/log版本太高,被锁在3.0.0了,加个参数-W试下

  • = - = 2022-03-11

    加了无效噢,需要进行版本降级。我加在提问的解决部分了

  • nitron 2022-03-11

    你这样 先把composer.lock 删掉,再require,monolog里composer.json对psr/log的要求是1.0,2.0,3.0都可以

  • = - = 2022-03-11

    好,我试试

  • = - = 2022-03-11

    可以。删除后重新安装就能装了

  • = - = 2022-03-11

    谢谢

  • nitron 2022-03-11

    官方关闭的issue

    https://github.com/cakephp/phinx/issues/2055

    大意就是psr/log v3需要cakephp5才支持,cakephp4不支持(spinx依赖cakephp4的datasource包)

  • = - = 2022-03-11

    嗯嗯。是这个原因。

  • = - = 2022-03-11

    datasource 依赖的版本还没升级,所以导致不能安装。早点休息吖。

年代过于久远,无法发表回答
×
🔝