laravel / reverb

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

Node dependency installation fails during Laravel Reverb setup #207

Closed JsExpertCoder closed 4 weeks ago

JsExpertCoder commented 1 month ago

Reverb Version

@beta

Laravel Version

^11.9

PHP Version

^8.2

Description

When installing Laravel Reverb via the php artisan install:broadcasting command, the installation process fails at the Node dependency installation step. The error message indicates a missing script: "build". This issue prevents the completion of the broadcasting setup. Additionally, neither the package.json file nor the node_modules folder is created during this process.

Steps To Reproduce

Steps To Reproduce

  1. Create a new Laravel project:
    laravel new project_name
  2. Run the broadcasting installation command:
    php artisan install:broadcasting
  3. Choose to install Laravel Reverb when prompted.

Observed Behavior:

The installation proceeds until the Node dependencies are being installed. The process stops with the following error message: npm ERR! Missing script: "build" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run

npm ERR! A complete log of this run can be found in: parth_to_logs WARN Node dependency installation failed. Please run the following commands manually: npm install --save-dev laravel-echo pusher-js && npm run build.

Expected Behavior:

The Node dependencies should be installed successfully, and the broadcasting setup should complete without any errors.

JsExpertCoder commented 1 month ago

the reason is the Breeze starter kit which excludes or doesn't even bring the "package.json" and "node_modules", so the node dependency installation fails during Laravel Reverb configuration

crynobone commented 1 month ago

https://github.com/laravel/framework/blob/c632b1f4435e46229eef6b2b0ae9950925057f76/src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php#L175-L177

Wouldn't it already be possible to run --without-node? and you should already be prompt to run node installation.

driesvints commented 4 weeks ago

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.