我如何解决“您的要求无法解决到一组可安装的软件包”错误? [英] How can I resolve "Your requirements could not be resolved to an installable set of packages" error?

查看:664
本文介绍了我如何解决“您的要求无法解决到一组可安装的软件包”错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 composer update 时,我收到一些有线输出。

When I run composer update I receive some wired output.

这里是我的composer.json样子。

Here is my composer.json look like.

>

如何解决这个问题?

推荐答案

您的软件依赖项版本冲突不兼容。

Your software dependencies have an incompatible version conflict.

同时你想安装任何Laravel 4.2.x版本,和zizaco /委托从它的主分支。这个主分支需要至少Laravel 5.0(大致来说)。

At the same time you want to install any Laravel 4.2.x version, and "zizaco/entrust" from it's master branch. And that master branch requires at least Laravel 5.0 (roughly speaking).

问题来自对分支的依赖。很可能这个包zizaco /委托一次在它的主分支使用Laravel 4.2,并且你能够安装你的依赖在那一天。但是,这个分支更新为不兼容的版本要求,你永远不能运行 composer update 并获得更新的依赖关系。

The problem comes from the dependency on branches. It's likely that the package zizaco/entrust once was using Laravel 4.2 in it's master branch, and that you were able to install your dependencies at that day. But the very moment this branch gets updated with an incompatible version requirement, you will never ever be able to run composer update and get updated dependencies.

始终使用带标签的版本!理想情况下,您使用宽松的版本要求,允许兼容的更新。这应该表示为波浪二号版本要求:〜1.2 将安装版本1.2.0及以上(如1.2.99或1.2.100),也是1.3以上。如果你需要一个补丁发布:插入三个版本 ^ 1.2.10 将安装1.2.10或更高,也1.3和更高。

Always use tagged versions! Ideally you use a relaxed version requirement that allows for compatible updates. This should be expressed as a tilde-two-number version requirement: ~1.2 would install a version 1.2.0 and up (like 1.2.99 or 1.2.100), and also 1.3 and up. If you need a certain patch release: Caret-three-number version ^1.2.10 will install 1.2.10 or up, also 1.3 and up.

使用此版本要求而不是 dev-master 将允许您使用已释放的版本,而不是主分支中的unstable状态,并允许你寻址仍然适用于Laravel 4.2的最新版本。我想这将是zizaco /委托版本1.3.0,但版本1.2也将有资格。使用zizaco / entrust:〜1.2

Using this version requirement instead of dev-master will allow you to use released versions instead of the unstable state in the master branch, and allows you to address the most recent version that still works with Laravel 4.2. I guess that would be zizaco/entrust version 1.3.0, but version 1.2 would also qualify. Go with "zizaco/entrust": "~1.2".

这篇关于我如何解决“您的要求无法解决到一组可安装的软件包”错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆