本文介绍了Composer无法安装Twig Extensions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我的Symfony 5应用程序的 dev-master 版本中安装 twig / extensions 软件包。我满足以下输出要求:

I tried installing the twig/extensions package in it's dev-master version in my Symfony 5 application. I am meeting the following output :

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for twig/extensions dev-master -> satisfiable by twig/extensions[dev-master].
    - Conclusion: remove twig/twig v3.0.3
    - Conclusion: don't install twig/twig v3.0.3
    - twig/extensions dev-master requires twig/twig ^2.10 -> satisfiable by twig/twig[v2.10.0, v2.11.0, v2.11.1, v2.11.2, v2.11.3, v2.12.0, v2.12.1, v2.12.2, v2.12.3, v2.12.4, v2.12.5].
    - Can only install one of: twig/twig[v2.10.0, v3.0.3].
    - Can only install one of: twig/twig[v2.11.0, v3.0.3].
    - Can only install one of: twig/twig[v2.11.1, v3.0.3].
    - Can only install one of: twig/twig[v2.11.2, v3.0.3].
    - Can only install one of: twig/twig[v2.11.3, v3.0.3].
    - Can only install one of: twig/twig[v2.12.0, v3.0.3].
    - Can only install one of: twig/twig[v2.12.1, v3.0.3].
    - Can only install one of: twig/twig[v2.12.2, v3.0.3].
    - Can only install one of: twig/twig[v2.12.3, v3.0.3].
    - Can only install one of: twig/twig[v2.12.4, v3.0.3].
    - Can only install one of: twig/twig[v2.12.5, v3.0.3].
    - Installation request for twig/twig (locked at v3.0.3) -> satisfiable by twig/twig[v3.0.3].

作为似乎要求 twig / twig 其版本为 ^ 2.10 我试图发现它的项目中有一个需要一些冲突的软件包(例如 ^ 3.0 ),但是似乎不存在一个软件包:

As the package page seems to require twig/twig in its version ^2.10 I tried to find it there was a package requiring something conflictual in my project (for instance ^3.0) but there do not seems to exist one :

$ composer why twig/twig
knplabs/knp-paginator-bundle  v5.1.1  requires  twig/twig (^2.0 || ^3.0)
symfony/twig-bridge           v5.0.4  requires  twig/twig (^2.10|^3.0)
symfony/twig-bundle           v5.0.4  requires  twig/twig (^2.10|^3.0)
symfony/twig-pack             v1.0.0  requires  twig/twig (^2.12|^3.0)
symfony/web-profiler-bundle   v5.0.4  requires  twig/twig (^2.10|^3.0)
twig/extra-bundle             v3.0.3  requires  twig/twig (^2.4|^3.0)

可以有人启发我为什么Composer无法解决我的要求?请随时要求输出更多评论。我将对其进行相应的编辑。

Could someone enlighten me on why Composer can't resolve my requirements ? Don't hesitate to ask for the output of more comments. I'll edit this accordingly.

此处 require require-dev composer.json 的code>键:

Here the require and require-dev keys of my composer.json :

"require": {
    "php": "^7.2.5",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "antishov/doctrine-extensions-bundle": "^1.4",
    "knplabs/knp-paginator-bundle": "^5.1",
    "sensio/framework-extra-bundle": "^5.1",
    "symfony/asset": "5.0.*",
    "symfony/console": "5.0.*",
    "symfony/dotenv": "5.0.*",
    "symfony/expression-language": "5.0.*",
    "symfony/flex": "^1.3.1",
    "symfony/form": "5.0.*",
    "symfony/framework-bundle": "5.0.*",
    "symfony/http-client": "5.0.*",
    "symfony/intl": "5.0.*",
    "symfony/mailer": "5.0.*",
    "symfony/monolog-bundle": "^3.1",
    "symfony/notifier": "5.0.*",
    "symfony/orm-pack": "*",
    "symfony/process": "5.0.*",
    "symfony/security-bundle": "5.0.*",
    "symfony/serializer-pack": "*",
    "symfony/string": "5.0.*",
    "symfony/translation": "5.0.*",
    "symfony/twig-pack": "*",
    "symfony/validator": "5.0.*",
    "symfony/web-link": "5.0.*",
    "symfony/webpack-encore-bundle": "^1.7",
    "symfony/yaml": "5.0.*"
},
"require-dev": {
    "doctrine/doctrine-fixtures-bundle": "^3.3",
    "fzaninotto/faker": "^1.9",
    "symfony/debug-pack": "*",
    "symfony/maker-bundle": "^1.0",
    "symfony/profiler-pack": "*",
    "symfony/test-pack": "*"
}


推荐答案

看起来您的树枝扩展包很漂亮

Looks like your twig extensions package has been pretty much abandoned!

来自packagist:

From packagist:

需要:
树枝/小枝:^ 1.27 | ^ 2.0

requires:twig/twig: ^1.27|^2.0

并在dev-master分支上:

and on the dev-master branch:

需要:
树枝/小枝:^ 2.10

requires:twig/twig: ^2.10

抱歉,朋友! https://packagist.org/packages/twig/extensions#dev-master

这篇关于Composer无法安装Twig Extensions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:06