laravel: [Bug]: php artisan native:serve requires yarn?
What happened?
Unable to serve NativePhp server via php artisan native:serve.
I am running MacOS and Laravel Valet.
How to reproduce the bug
- Installed Laravel.
- Installed NativePhp via composer
- Installed NativePhp via
php artisan native:install - Would you like to install the NativePHP NPM dependencies? (yes/no) [yes]:
yes
- Would you like to start the NativePHP development server (yes/no) [no]:
yes and output is
Starting NativePHP dev server…
Fetching latest dependencies…
Starting NativePHP app…
sh: yarn: command not found
NativePHP scaffolding installed successfully.
Also running php artisan native:serve
Results in same output.
Package Version
Alpha Laracon release
PHP Version
8.1.19
Laravel Version
10.15.0
Which operating systems does with happen with?
macOS
Notes
Do I need to explicitly install and configure yarn for NativePhp?
Eagerly waiting to give it a try. A lots of Love.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 19 (1 by maintainers)
You need to enable
corepackfor node via runningcorepack enablein terminal.If you are Node.js ^16.17 or >=18.6
corepack prepare yarn@stable --activateI was able to run basic application after enabling
corepack.Yarn is now no longer used and we default to npm everywhere
That work for me. It is running now. But when native:install and native:serve, that only published NativeAppServiceProvider. I don’t even get config file.
This did it for me, however now i’m running in to this issue https://github.com/NativePHP/laravel/issues/16, so i’ll move on from this thread 😃
Thanks, @mraheelkhan !
I can confirm the same here. Latest MacOS, Macbook Air M1 running PHP through Herd.