【发布时间】:2020-06-03 08:03:00
【问题描述】:
我已经安装了 CakePHP 3.0.13。在尝试跳转到 4.x 分支之前,我想升级到 3.8。我已经启动了这个:composer require cakephp/cakephp:3.8.12,我得到了下一个结果:
./composer.json has been updated
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
- cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
- cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
- cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found.
- Installation request for cakephp/migrations 1.3.2 -> satisfiable by cakephp/migrations[1.3.2].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
迁移包似乎存在依赖性问题:Cake 需要对 Migrations 进行升级,但 Migrations 要求 cake 保持在 3.0.*。在vendor/cakephp/migrations/composer.json 我有:
...
"require": {
"php": ">=5.4",
"robmorgan/phinx": ">=0.4.2 <0.5.0",
"cakephp/cakephp": "3.0.*"
},
...
我也尝试使用 composer 升级迁移,但我遇到了相反的问题:cakephp 应该升级,所以我被卡住了。有什么建议么?提前谢谢!
【问题讨论】:
-
一次升级所有依赖,不是一个一个。如果仍然存在问题,请删除
vendor文件夹和composer.lock文件,即使所有依赖项都应该兼容。 -
我已删除
vendor/*和composer.lock。然后我用"cakephp/cakephp": "3.8.12",编辑了composer.json并启动了composer install。我有同样的结果(除了关于 PHP 版本的其他人):-Installation request for cakephp/migrations 1.3.2 -> satisfiable by cakephp/migrations[1.3.2]. - - cakephp/migrations 1.3.2 requires cakephp/cakephp 3.0.* -> no matching package found. -
如前所述,一次升级 所有 依赖项,需要兼容 CakePHP、Migrations 以及应用程序
composer.json中的任何其他依赖项的兼容版本。跨度> -
你能分享你自己的
composer.json吗?其他包需要的任何东西都可能不那么相关
标签: cakephp composer-php migration cakephp-3.x