【问题标题】:Error while trying to install websocket in laravel using composer require beyondcode/laravel-websockets [duplicate]尝试使用 composer 在 laravel 中安装 websocket 时出错需要 Beyondcode/laravel-websockets [重复]
【发布时间】:2022-01-11 19:28:04
【问题描述】:

在我的 laravel 项目中安装 websocket 时,我遇到了 composer 错误。我的目的是安装这个 websocket 并将它用于实时通知, 但是在发出安装命令后我遇到了错误。下面是我所面临的:

  Problem 1
- Conclusion: don't install beyondcode/laravel-websockets 1.12.0
- Conclusion: remove guzzlehttp/psr7 2.1.0
- Installation request for beyondcode/laravel-websockets ^1.12 -> satisfiable by beyondcode/laravel-websockets[1.12.0, 1.x-dev].
- Conclusion: don't install guzzlehttp/psr7 2.1.0
- beyondcode/laravel-websockets 1.x-dev requires guzzlehttp/psr7 ^1.5 -> satisfiable by guzzlehttp/psr7[1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.6.1, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.x-dev].
- Can only install one of: guzzlehttp/psr7[1.7.0, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.8.0, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.8.1, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.8.2, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.8.3, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.x-dev, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.5.0, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.5.1, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.5.2, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.6.0, 2.1.0].
- Can only install one of: guzzlehttp/psr7[1.6.1, 2.1.0].
- Installation request for guzzlehttp/psr7 (locked at 2.1.0) -> satisfiable by guzzlehttp/psr7[2.1.0].

安装失败,正在将 ./composer.json 还原为其原始内容。

谁能帮我解决这个问题..

【问题讨论】:

  • 特别是:您的任何其他软件包似乎在 v2 中都需要 guzzlehttp/psr7,而您现在想要的软件包取决于 v1 中的 guzzlehttp/psr7。你可以查查是哪一个是罪魁祸首,或者请beyondcode/laravel-websockets的维护者发布一个兼容的新版本
  • 在 composer.js 中更改 guzzlehttp 版本并运行 comoser update "guzzlehttp/guzzle": "^7.0.1",
  • 谢谢@Usman,按照您的建议,在降级“guzzlehttp/guzzle”版本后,我已经成功安装了 Beyondcode/laravel-websockets,对我来说它是必需的版本“^1.5”。跨度>

标签: laravel composer-php guzzle


【解决方案1】:

降级 guzzlehttp/guzzle 版本

在 composer.json 中做更改 这些是根据 Laravel 8 和 PHP 8.0

尝试降级或升级,直到它开始工作。

"php": "^7.3|^8.0",

"beyondcode/laravel-websockets": "^1.12"

"guzzlehttp/guzzle": "^7.0.1",
"laravel/框架": "^8.40",

【讨论】:

    猜你喜欢
    • 2021-10-09
    • 2015-12-22
    • 2020-08-24
    • 2020-06-25
    • 2014-12-01
    • 2017-07-13
    • 2021-06-25
    • 2015-09-13
    • 2021-09-10
    相关资源
    最近更新 更多