laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.07k stars 80 forks source link

Windows not supported (yet)? #65

Closed kayschima closed 6 months ago

kayschima commented 6 months ago

Reverb Version

v1.0.0-beta2

Laravel Version

11.0.2

PHP Version

8.3.2

Description

When I install Reverb I get the error message:

Would you like to install and build the Node dependencies required for broadcasting? (yes/no) [yes]
❯

   INFO  Installing and building Node dependencies.

   Symfony\Component\Process\Exception\RuntimeException

  TTY mode is not supported on Windows platform.

  at vendor\symfony\process\Process.php:1013
    1009▕      */
    1010▕     public function setTty(bool $tty): static
    1011▕     {
    1012▕         if ('\\' === \DIRECTORY_SEPARATOR && $tty) {
  ➜ 1013▕             throw new RuntimeException('TTY mode is not supported on Windows platform.');
    1014▕         }
    1015▕
    1016▕         if ($tty && !self::isTtySupported()) {
    1017▕             throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.');

Is Windows not supported for Reverb?

Steps To Reproduce

laravel new laravel11
php artisan install:broadcasting
kayschima commented 6 months ago

Addition: I do not use WSL on Windows.

OussamaMater commented 6 months ago

I don't think it is related to Reverb itself. The install:broadcasting command is included with Laravel 11, not Reverb. When running it, TTY is required (check here), but it is not supported in Windows. You can manually install npm dependencies since Reverb was already installed if you reached that part.

npm install --save-dev laravel-echo pusher-js
npm run build

The command is just for convenience. You can check what it is doing and manually perform the steps while the issue is being resolved for Windows. https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php

ThibautGobert commented 6 months ago

I am also on Windows and I can't start it, I get this error :

Undefined constant "Laravel\Reverb\Servers\Reverb\Console\Commands\SIGINT"

Laravel\Reverb\Servers\Reverb\Console\Commands\StartServer::getSubscribedSignals()

kayschima commented 6 months ago

@OussamaMater : I guess you're right.

So, this should be either fixed in the Laravel repository or be mentioned in the documentation.

njzabala commented 6 months ago

@ThibautGobert: It is related with PCNTL PHP extension which is currently unavailable for Windows

https://stackoverflow.com/questions/78150154/issue-starting-laravel-reverb-server-on-windows-undefined-constant-error

OussamaMater commented 6 months ago

@kayschima Yes exactly!

driesvints commented 6 months ago

Right now we have no plans for non WSL versions of Windows sorry.

driesvints commented 6 months ago

Seems someone is actually working on a fix: https://github.com/laravel/framework/pull/50495

doraemonxxx commented 6 months ago

facing the same issue. I don't use WSL, only Laragon and php extension does not support windows 💀

driesvints commented 6 months ago

Re-opening this for now.

driesvints commented 6 months ago

We released https://github.com/laravel/framework/pull/50519 in v11.0.5 so please upgrade. Thanks.

kayschima commented 6 months ago

Installation works fine now with 11.0.5. The SIGINT error is still there on startup of the service.

driesvints commented 6 months ago

Aaaah I thought it was just the issue within framework itself. Seems like a PR was made so we'll get this in soon.