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

  1. Installed Laravel.
  2. Installed NativePhp via composer
  3. Installed NativePhp via php artisan native:install
  4. Would you like to install the NativePHP NPM dependencies? (yes/no) [yes]:

yes

  1. 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)

Most upvoted comments

You need to enable corepack for node via running corepack enable in terminal.

If you are Node.js ^16.17 or >=18.6 corepack prepare yarn@stable --activate

I was able to run basic application after enabling corepack.

Yarn is now no longer used and we default to npm everywhere

You need to enable corepack for node via running corepack enable in terminal.

If you are Node.js ^16.17 or >=18.6 corepack prepare yarn@stable --activate

I was able to run basic application after enabling corepack.

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.

You need to enable corepack for node via running corepack enable in terminal.

If you are Node.js ^16.17 or >=18.6 corepack prepare yarn@stable --activate

I was able to run basic application after enabling corepack.

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.