【问题标题】:Error while installing friendsofsymfony/user-bundle安装friendsofsymfony/user-bundle时出错
【发布时间】:2019-01-30 05:42:33
【问题描述】:

在安装Symfony 用户包的朋友时,我遇到了这个错误。有人可以帮我解决这个问题吗?

Ahmeds-MBP:placementlink2 ahmed$ composer require friendsofsymfony/user-bundle 
Using version ^2.1 for friendsofsymfony/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 
- Conclusion: don't install friendsofsymfony/user-bundle v2.1.2 
- Conclusion: don't install friendsofsymfony/user-bundle v2.1.1 
- Conclusion: don't install twig/twig v2.5.0 
- Conclusion: remove twig/twig v1.23.1 
- Conclusion: don't install twig/twig v2.4.8 
- Installation request for friendsofsymfony/user-bundle ^2.1 -> satisfiable by friendsofsymfony/user-bundle[v2.1.0, v2.1.1, v2.1.2]. 
- Conclusion: don't install twig/twig v1.23.1 
- friendsofsymfony/user-bundle v2.1.0 requires twig/twig ^1.28 || ^2.0 -> satisfiable by twig/twig[v1.28.0, v1.28.1, v1.28.2, v1.29.0, v1.30.0, v1.31.0, v1.32.0, v1.33.0, v1.33.1, v1.33.2, v1.34.0, v1.34.1, v1.34.2, v1.34.3, v1.34.4, v1.35.0, v1.35.1, v1.35.2, v1.35.3, v1.35.4, v2.0.0, v2.1.0, v2.2.0, v2.3.0, v2.3.1, v2.3.2, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.5.0]. 
- Can only install one of: twig/twig[v1.28.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.28.1, v1.23.1]. 
- Can only install one of: twig/twig[v1.28.2, v1.23.1]. 
- Can only install one of: twig/twig[v1.29.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.30.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.31.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.32.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.33.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.33.1, v1.23.1]. 
- Can only install one of: twig/twig[v1.33.2, v1.23.1]. 
- Can only install one of: twig/twig[v1.34.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.34.1, v1.23.1]. 
- Can only install one of: twig/twig[v1.34.2, v1.23.1]. 
- Can only install one of: twig/twig[v1.34.3, v1.23.1]. 
- Can only install one of: twig/twig[v1.34.4, v1.23.1]. 
- Can only install one of: twig/twig[v1.35.0, v1.23.1]. 
- Can only install one of: twig/twig[v1.35.1, v1.23.1]. 
- Can only install one of: twig/twig[v1.35.2, v1.23.1]. 
- Can only install one of: twig/twig[v1.35.3, v1.23.1]. 
- Can only install one of: twig/twig[v1.35.4, v1.23.1]. 
- Can only install one of: twig/twig[v2.0.0, v1.23.1]. 
- Can only install one of: twig/twig[v2.1.0, v1.23.1]. 
- Can only install one of: twig/twig[v2.2.0, v1.23.1]. 
- Can only install one of: twig/twig[v2.3.0, v1.23.1]. 
- Can only install one of: twig/twig[v2.3.1, v1.23.1]. 
- Can only install one of: twig/twig[v2.3.2, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.0, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.1, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.2, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.3, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.4, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.5, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.6, v1.23.1]. 
- Can only install one of: twig/twig[v2.4.7, v1.23.1]. 
- Installation request for twig/twig (locked at v1.23.1) -> satisfiable by twig/twig[v1.23.1].

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

这是我的 composer.json 文件:

"require":{  
  "php":">=5.5.9",
  "symfony/symfony":"3.0.*",
  "doctrine/orm":"^2.5",
  "doctrine/doctrine-bundle":"^1.6",
  "doctrine/doctrine-cache-bundle":"^1.2",
  "symfony/swiftmailer-bundle":"^2.3",
  "symfony/monolog-bundle":"^2.8",
  "sensio/distribution-bundle":"^5.0",
  "sensio/framework-extra-bundle":"^3.0.2",
  "incenteev/composer-parameter-handler":"^2.0"
},
"require-dev":{  
  "sensio/generator-bundle":"^3.0",
  "symfony/phpunit-bridge":"^2.7"
},

【问题讨论】:

  • 你能把你composer.json的内容贴出来吗?
  • 对我来说这看起来像是一些令人讨厌的升级依赖冲突。这是新安装还是升级?
  • 你能解释一下你所说的讨厌的升级依赖冲突是什么意思吗?
  • 可以,但首先我需要知道这是否真的是 Symfony 的新安装?
  • 请更新问题并保持格式...

标签: php symfony fosuserbundle composer-php


【解决方案1】:

我为您上面提到的issue 做了一些谷歌搜索,似乎有一个错误修复。不幸的是,据我了解,该修复并未移植到 3.0 版本,因为在出​​现该错误时,3.0 不再维护:

Fabien Potencier (fabpot) 于 2016 年 10 月 23 日发表评论

哦,我看到你使用的是Symfony 3.0。不幸的是,它不会工作,因为 3.0 不再维护。您需要升级到3.1 或使用Twig 1.x

请按照 Fabien 的建议进行操作,您应该可以解决问题。

希望这会有所帮助...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-25
    • 1970-01-01
    • 2018-04-19
    • 1970-01-01
    • 1970-01-01
    • 2012-12-22
    • 2017-08-27
    相关资源
    最近更新 更多