我正在尝试导入 Google 的 Text-To-Speech 库composer require google/cloud-text-to-speech但我收到这个错误Using version ^0.4.4 for google/cloud-text-to-speech./composer.json has been updatedLoading composer repositories with package informationUpdating dependencies (including require-dev)Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for google/cloud-text-to-speech ^0.4.4 -> satisfiable by google/cloud-text-to-speech[v0.4.4]. - Conclusion: don't install google/gax 0.37.0 - google/cloud-text-to-speech v0.4.4 requires google/gax ^1.0 -> satisfiable by google/gax[1.0.0, 1.0.1, 1.0.2, 1.0.3]. - Can only install one of: google/gax[1.0.0, 0.37.0]. - Can only install one of: google/gax[1.0.1, 0.37.0]. - Can only install one of: google/gax[1.0.2, 0.37.0]. - Can only install one of: google/gax[1.0.3, 0.37.0]. - Installation request for google/gax (locked at 0.37.0) -> satisfiable by google/gax[0.37.0].Installation failed, reverting ./composer.json to its original content.我怎样才能解决这个问题?是否有任何可用的库可以在不使用 Composer 的情况下下载?
1 回答
犯罪嫌疑人X
TA贡献2080条经验 获得超4个赞
看起来您或您项目中的另一个依赖项也需要google/gax
,但在旧版本中。您可以google/gax
使用为什么命令找出为什么被锁定在 0.37.0 版本:
composer why google/gax
这应该告诉您它是作为根依赖项安装的,这意味着您明确安装了它还是其他依赖项需要它。
然后您必须找出该依赖项是否有更新版本,以便您可以升级该依赖项以便能够使用更新版本的google/gax
. 如果您确定更新它是安全的,只需将两个扩展添加到 require 命令或先更新依赖项,然后google/cloud-text-to-speech
再次尝试 require 。
Composer 还提供了一种为您自动更新所有依赖项的方法,但这显然存在从更新中引入破坏性更改的风险,因此请谨慎使用它:
--update-with-dependencies Allows inherited dependencies to be updated, except those that are root requirements. --update-with-all-dependencies Allows all inherited dependencies to be updated, including those that are root requirements.
所以运行:
composer require --update-with-all-dependencies google/cloud-text-to-speech
应该以支持所需版本的方式更新您的应用程序google/gax
,以便安装google/cloud-text-to-speech
. 这可能会导致更新其他依赖项,您可以检查输出以查看哪些受到影响。
- 1 回答
- 0 关注
- 157 浏览
添加回答
举报
0/150
提交
取消