-
-
Notifications
You must be signed in to change notification settings - Fork 204
Description
What were you trying to do?
I was trying to build my Laravel 12 + NativePHP Electron application on Windows 11 for production.
What happened?
-
When running php artisan native:build, the build process fails because fsevents (a macOS-only dependency) is being required on Windows.
-
On a fresh Laravel 12 app with nativephp/electron, the Windows PHP binaries directory only includes php-8.4.zip but not php-8.3.zip, while Linux and macOS include both 8.3 and 8.4.
To work around this, I must manually edit vendor/nativephp/electron/resources/js/php.js to force it to use 8.4 instead of 8.3.
The binaries folder vendor/nativephp/php-bin/bin/win/x64 is missing php-8.3.zip.
- Artisan commands php artisan native:db:seed and php artisan native:seed return "unknown command" on Windows (haven’t tested on Mac/Linux).
Because of these issues, Windows builds are currently not possible without manual hacks.
How to reproduce the bug
-
Create a fresh Laravel 12 project on Windows 10.
-
Install nativephp/electron.
-
Run the app → observe missing php-8.3.zip in vendor/nativephp/php-bin/bin/win/x64.
Workaround: manually edit vendor/nativephp/electron/resources/js/php.js to use 8.4.
- Run:
php artisan native:build
→ Build fails with ENOENT: no such file or directory, scandir '...\fsevents'.
- Run:
php artisan native:db:seed
php artisan native:seed
→ Both commands return unknown command.
Debug Output
renderer config is missing
vite v6.3.5 building SSR bundle for production...
transforming...
✓ 33 modules transformed.
rendering chunks...
out/main/index.js 70.33 kB
✓ built in 675ms
vite v6.3.5 building SSR bundle for production...
transforming...
✓ 1 modules transformed.
rendering chunks...
out/preload/index.mjs 0.17 kB
✓ built in 34ms
• electron-builder version=26.0.15 os=10.0.22000
• updater config { provider: 'spaces', name: null, region: null, path: null }
• loaded configuration file=C:\Users\AsianManiac\Herd\application\vendor\nativephp\electron\resources\js\electron-builder.js
• building php binary - exec php.js --win --x64
• skipped dependencies rebuild reason=npmRebuild is set to false
• packaging platform=win32 arch=x64 electron=32.3.3 appOutDir=C:\Users\AsianManiac\Herd\application\dist\win-unpacked
⨯ ENOENT: no such file or directory, scandir 'C:\Users\AsianManiac\Herd\application\vendor\nativephp\electron\resources\js\node_modules\fsevents'
failedTask=build
stackTrace=Error: ENOENT: no such file or directory, scandir '...\fsevents
Which operating systems have you seen this occur on?
Windows
Notes
Tested only on Windows 11, but likely reproducible on other Windows versions.
Environment:
Laravel: 12.0
NativePHP: latest (nativephp/electron)
PHP: 8.3 / 8.4
Node: installed via project dependencies