【发布时间】: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