我尝试在 Symfony 5.1 项目中安装 Doctrine ORM,但出现以下错误:composer require symfony/orm-packUsing version ^1.1 for symfony/orm-pack./composer.json has been updatedLoading composer repositories with package informationUpdating dependencies (including require-dev)Restricting packages listed in "symfony/symfony" to "5.1.*"Your requirements could not be resolved to an installable set of packages. Problem 1 - doctrine/doctrine-migrations-bundle v2.0.0 requires symfony/framework-bundle ~3.4|~4.0 -> no matching package found. - Installation request for symfony/orm-pack ^1.1 -> satisfiable by symfony/orm-pack[v1.1.0]. - Conclusion: remove doctrine/doctrine-migrations-bundle 3.0.1 - Conclusion: don't install doctrine/doctrine-migrations-bundle 3.0.1 - symfony/orm-pack v1.1.0 requires doctrine/doctrine-migrations-bundle ^2 -> satisfiable by doctrine/doctrine-migrations-bundle[2.1.0, 2.1.1, 2.1.2, v2.0.0]. - Can only install one of: doctrine/doctrine-migrations-bundle[2.1.0, 3.0.1]. - Can only install one of: doctrine/doctrine-migrations-bundle[2.1.1, 3.0.1]. - Can only install one of: doctrine/doctrine-migrations-bundle[2.1.2, 3.0.1]. - Installation request for doctrine/doctrine-migrations-bundle (locked at 3.0.1) -> satisfiable by doctrine/doctrine-migrations-bundle[3.0.1].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. - It's a private package and you forgot to add a custom repository to find itRead <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.Installation failed, reverting ./composer.json to its original content.我需要什么版本才能在 Symfony 5.1 中使用 Doctrine?我尝试过安装composer req doctrine/doctrine-migrations-bundle:2.0composer require symfony/orm-pack:1.1但两者都失败了。
2 回答
PIPIONE
TA贡献1829条经验 获得超9个赞
已经存在一些关于此的问题,请参阅https://github.com/symfony/orm-pack/issues/18或https://github.com/symfony/orm-pack/issues/29 - 问题:自上次发布以来,ORM 包需要 Doctrine v2。根据您提供的软件包列表,您doctrine/doctrine-migrations-bundle 3.0.1
之前需要。
有两种可能的解决方案:要么将doctrine/doctrine-migrations-bundle
其他与 Doctrine 相关的包降级到 v2,直到错误消息消失,要么跳过 ORM 包并需要在该包中编写的包。symfony/orm-pack
如果您已经安装了迁移包,则额外安装没有任何好处
拉风的咖菲猫
TA贡献1995条经验 获得超2个赞
对于任何在尝试 require 时遇到“无法解析版本约束 orm-packorm-pack
”错误的人,这是关键,然后运行:
composer require orm
https://github.com/symfony/flex/issues/820#issuecomment-942016309
- 2 回答
- 0 关注
- 143 浏览
添加回答
举报
0/150
提交
取消