Composer - 无法更新composer.json

时间:2017-01-25 10:25:04

标签: php composer-php symfony

我试图在新的symfony项目中使用sonata-project / user-bundle。

但是当我进行更新时出现了这个错误:

 composer require sonata-project/user-bundle
 Using version ^3.2 for sonata-project/user-bundle
 ./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
- Installation request for sonata-project/user-bundle ^3.2 -> satisfiable by sonata-project/user-bundle[3.2.0].
- Conclusion: remove symfony/symfony v3.2.1
- Conclusion: don't install symfony/symfony v3.2.1
- sonata-project/user-bundle 3.2.0 requires symfony/form ^2.3 -> satisfiable by symfony/form[v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.14, v2.3.15, v2.3.16, v2.3.17, v2.3.18, v2.3.19, v2.3.2, v2.3.20, v2.3.21, v2.3.22, v2.3.23, v2.3.24, v2.3.25, v2.3.26, v2.3.27, v2.3.28, v2.3.29, v2.3.3, v2.3.30, v2.3.31, v2.3.32, v2.3.33, v2.3.34, v2.3.35, v2.3.36, v2.3.37, v2.3.38, v2.3.39, v2.3.4, v2.3.40, v2.3.41, v2.3.42, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9, v2.4.0, v2.4.1, v2.4.10, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.4.9, v2.5.0, v2.5.1, v2.5.10, v2.5.11, v2.5.12, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8, v2.5.9, v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.12, v2.6.13, v2.6.2, v2.6.3, v2.6.4, v2.6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9, v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.21, v2.7.22, v2.7.23, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.16, v2.8.2, v2.8.3, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].

- don't install symfony/form v2.3.4|don't install symfony/symfony v3.2.1
......
- don't install symfony/form v2.3.4|don't install symfony/symfony v3.2.1

- Installation request for symfony/symfony (locked at v3.2.1, required as 3.2.*) -> satisfiable by symfony/symfony[v3.2.1].


 Installation failed, reverting ./composer.json to its original content.

当你遇到这种错误时,下一步是什么?

由于

1 个答案:

答案 0 :(得分:3)

sonata-project/user-bundle@3.2.0与您在symfony/symfony@3.2.1中也需要的composer.json不兼容。

你有2个解决方案:

  • 未使用sonata-project/user-bundle
  • symfony/symfony降级为适用于sonata-project/user-bundle的版本。版本必须是^ 2.3。