我正试图在我的Laravel项目中使用Composer安装beyondcode/laravel-websockets包,但我遇到了依赖问题.当我运行命令composer require beyondcode/laravel-websockets时,我收到以下错误:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - beyondcode/laravel-websockets 1.14.0 requires react/http ^1.1 -> satisfiable by react/http[v1.1.0, ..., v1.9.0].
    - beyondcode/laravel-websockets[1.0.0, ..., 1.3.0] require php ^7.1 -> your php version (8.2.6) does not satisfy that requirement.
    - beyondcode/laravel-websockets[1.4.0, ..., 1.10.0] require php ^7.2 -> your php version (8.2.6) does not satisfy that requirement.
    - beyondcode/laravel-websockets[1.11.0, ..., 1.13.0] require guzzlehttp/psr7 ^1.5 -> found guzzlehttp/psr7[1.5.0, ..., 1.9.1] but the package is fixed to 2.5.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - beyondcode/laravel-websockets[1.13.1, ..., 1.13.2] require illuminate/broadcasting ^6.0|^7.0|^8.0|^9.0 -> found illuminate/broadcasting[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.9] but these were not loaded, likely because it conflicts with another require.
    - react/http[v1.1.0, ..., v1.9.0] require psr/http-message ^1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires beyondcode/laravel-websockets * -> satisfiable by beyondcode/laravel-websockets[1.0.0, ..., 1.14.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require beyondcode/laravel-websockets:*" to figure out if any version is installable, or "composer require beyondcode/laravel-websockets:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

我的系统上安装了PHP8.2.6版.该包似乎需要较低版本的PHP和一些特定版本的其他依赖项.有没有办法用8.2.6版的PHP安装beyondcode/laravel-websockets版的包?如果没有,是否有其他解决方案或变通办法可用?我很感激任何帮助或指导.谢谢!

推荐答案

我想你正面临着BeyondCode laravel WebSocket包的版本问题,我也有同样的问题,在搜索后,我发现了这个YouTube视频,它解释了如何在laravel 10上安装BeyondCode Laravel Web Socket.

composer require beyondcode/laravel-websockets -w

https://youtu.be/8RL584c7EsI

Laravel相关问答推荐

如何通过单击进入 vs 代码中的类

Laravel & Docker:无法打开流或文件/var/www/html/storage/logs/laravel.log:无法打开流:权限被拒绝

FileViewFinder.php 第 137 行中的 Laravel 5 InvalidArgumentException:未找到视图 [.admin]

Laravel 有Many Many to Many To One Eloquent

即使上传了文件,Laravel Input::hasFile('image') 也会返回 false

Lumen和 MongoDB?

如何使用 laravel eloquent 获得select count(*) group by

file_put_content ...无法打开流:Laravel 5 中的权限被拒绝

Laravel Electron邮件验证模板位置

在 Laravel 中显示已注册的路由

Eloquent ORM,deleted_at 使用软删除时没有索引

Laravel Eloquent:计算总价的最佳方法

Laravel 和 PHPStorm 项目的 gitignore 中包含什么?

Laravel 5.1-5.8 中以前的路由名称

Laravel 无法创建根目录

Laravel 迁移命名约定

Laravel 存储链接不适用于生产

你如何在 Laravel 中的每个响应上强制一个 JSON 响应?

Laravel 从公共删除目录

错误:找不到模块 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' 需要堆栈: