Sár*_*ály 5 php laravel composer-php php-carbon
我在 cmd 中试过“composer 需要 nesbot/carbon”,但我得到了这个:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.6.27 requires nesbot/carbon 1.25.* -> satisfiable by nesbot/carbon[1.25.0] but these conflict with your requirements or minimum-stability.
- laravel/framework v5.6.27 requires nesbot/carbon 1.25.* -> satisfiable by nesbot/carbon[1.25.0] but these conflict with your requirements or minimum-stability.
- laravel/framework v5.6.27 requires nesbot/carbon 1.25.* -> satisfiable by nesbot/carbon[1.25.0] but these conflict with your requirements or minimum-stability.
- Installation request for laravel/framework (locked at v5.6.27, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.27].
Installation failed, reverting ./composer.json to its original content.
Run Code Online (Sandbox Code Playgroud)
我不建议在没有极其谨慎的情况下这样做,因为 Laravel 或任何其他依赖项可能需要非常严格的包版本。
话虽如此,Composer 确实包含了一个巧妙的别名版本技巧,可以通过在 中指定别名版本来解决这个问题composer.json
:
"require": {
...
"nesbot/carbon": "1.32.0 as 1.25.0"
},
Run Code Online (Sandbox Code Playgroud)
请注意,as 1.25.0
这会欺骗其他包,使其认为1.32.0
等同于1.25.0
依赖关系。这个技巧需要精确的版本。
归档时间: |
|
查看次数: |
14028 次 |
最近记录: |