Closed hasanuzzamanbe closed 7 months ago
With latest version nativephp/electron (0.3.2) I call:
php artisan native:build mac
It generates me .dmg file. Also I copied vendor/nativephp/php-bin/bin/mac/arm64 to vendor/nativephp/php-bin/bin/mac/x64
When i run on my macOS the command : php artisan native:build mac all my packages are removed and without .dmg file.
With latest version nativephp/electron (0.3.2) I call:
php artisan native:build mac
It generates me .dmg file. Also I copied vendor/nativephp/php-bin/bin/mac/arm64 to vendor/nativephp/php-bin/bin/mac/x64
I tried then it throw errors like this
Error copying PHP binary Error: ENOENT: no such file or directory, stat '/Volumes/Projects/debugger/vendor/nativephp/php-bin/bin/mac/x64'
Could not resolve "../../resources/php/php?asset&asarUnpack" from "src/main/index.js"
After a quick debugging, I am able to build the package for macOS.
PHP binary for x64 was not present on the path it was looking for. Don't know why it was not created automatically. I copied it from the Linux directory and paste it into the mac
directory.
And it works.
Same here...
I copied it from the Linux directory and paste it into the mac directory.
I'm not quite sure how this works, but I'd be very cautious about this as the binaries are built for each platform and won't be 100% interchangeable - something you'd absolutely want to avoid when it comes to distributing your app.
@hasanuzzamanbe Based on what you've reported, I'm assuming that you're developing on an Intel Mac... is that correct?
Same issue here, tried your fix it did actually open this time but with an error Test.app/Contents/Resources/app.asar.unpacked/resources/php/php EACCES at ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:476:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Almost worked then!
With latest version nativephp/electron (0.3.2) I call:
php artisan native:build mac
I tried then it throw errors like this
Error copying PHP binary Error: ENOENT: no such file or directory, stat '/Volumes/Projects/debugger/vendor/nativephp/php-bin/bin/mac/x64'
Could not resolve "../../resources/php/php?asset&asarUnpack" from "src/main/index.js"
Just to give my feedback too. I got the same error on Intel Mac. Tried on the last 2 releases, same behavior.
same here
error during build: RollupError: Could not resolve "../../resources/php/php?asset&asarUnpack" from "src/main/index.js" at error (file:///Users/ktech/code/phpnative/phpnative/vendor/nativephp/electron/resources/js/node_modules/rollup/dist/es/shared/node-entry.js:2245:30) at ModuleLoader.handleInvalidResolvedId (file:///Users/ktech/code/phpnative/phpnative/vendor/nativephp/electron/resources/js/node_modules/rollup/dist/es/shared/node-entry.js:24736:24) at file:///Users/ktech/code/phpnative/phpnative/vendor/nativephp/electron/resources/js/node_modules/rollup/dist/es/shared/node-entry.js:24698:26
I copied it from the Linux directory and paste it into the mac directory.
I'm not quite sure how this works, but I'd be very cautious about this as the binaries are built for each platform and won't be 100% interchangeable - something you'd absolutely want to avoid when it comes to distributing your app.
@hasanuzzamanbe Based on what you've reported, I'm assuming that you're developing on an Intel Mac... is that correct?
Sorry it was "Apple M1 Pro" chip
Yes, Mac based on intel i3 processor
I have same issue working on linux an traying to build to linux, win and mac, even wothout parameter the output is the same
In another device with windows before update, I was able to build, the app does not show any window but at least it could be build, after update I got the same issue on windows too.
Had the same error with a composer update
Just updated nativephp/electron from 4.0 to 6.0 and this whole issue is fixed! 🎉
Did you tried to update nativephp ?
composer require nativephp/electron
It work, but now i got
Looks like some step is missing or skipped where it should try to install the latest set of NPM dependencies
Please note that you can't build for Mac when you're not on a Mac
I've droped node_modules and vendor folders and reinstall them and it work. then i tried to build for linux and even when the app is created and actually it work, I got next console messages
Now i'll try to build for windows on windows whit this updates
Thanks!!!
That seems to be an error within electron-builder. Not sure what it means exactly, but it seems it might be bypass-able (if I'm interpreting the message correctly)
I'll try to replicate it at some point and find a way to bounce past it, but it would be helpful to raise that as a separate issue as it's off-track from this thread.
Ok, I'll put on new one!!! Thanks
For everyone else: there have been a load of improvements to NativePHP recently.
Please update to nativephp/electron v0.6 and try again.
What happened?
php artisan native:build
command executed laravel/sanctum ....................................................... DONE laravel/tinker ........................................................ DONE nativephp/electron .................................................... DONE nativephp/laravel ..................................................... DONE nesbot/carbon ......................................................... DONE nunomaduro/termwind ................................................... DONEthen exit with this error "electron-vite: command not found"
How to reproduce the bug
php artisan native:install
php artisan native:build
then exit with this error "electron-vite: command not found"Package Version
0.2.0
PHP Version
8.1
Laravel Version
10.10
Node Version
14.20.1
Which operating systems does with happen with?
macOS
Notes
No response