Closed Kuharenko closed 1 year ago
Same here. With Apple M1 CPU
Apple M1 CPU too.
As far as I can (understand/imagine) there should be a publisher service in config/nativephp.php
S3 or spaces...
Looks like the env
variables are important in the build process.
I do not know exactly how that process works... I think that we should wait until updating your app
in docs get filled
I noticed that there is entire folder missing on the nativePHP electron package when installed via composer.
When checking on previous commits the php.js file was available but inside a folder that is no longer available on the main branch source
I did replace the folders and changed the way BuildCommand.php file runs yarn and it worked.
In case you want to check the logs
Edit: dig some digging and found out that NativePHP electron package has been split to 2 packages where the ‘electron-plugin’ is being leveraged. Looks like that’s causing the build to fail.
I have the same issue
Error: Cannot find module '/Users/folder/nativephp/vendor/nativephp/electron/resources/js/php.js'
$issue++ along similar lines as above...
Mine runs with flags set to arm64 even though this machine is an MacPro (x86). Wonder if it is not being picked up on install etc? On quick look, didnt see any config option to override.
~/Development.local/nativephp/cronikl on main ❯ php artisan native:build
Build NativePHP app…
up to date, audited 574 packages in 39s
81 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
INFO Discovering packages.
laravel/sanctum ....................................................... DONE
laravel/tinker ........................................................ DONE
livewire/livewire ..................................................... DONE
nativephp/electron .................................................... DONE
nativephp/laravel ..................................................... DONE
nesbot/carbon ......................................................... DONE
nunomaduro/termwind ................................................... DONE
54 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> NativePHP@1.0.0 build:mac-arm
> cross-env node php.js --arm64 && cross-env npm run build && cross-env electron-builder -p never --mac --config --arm64
node:internal/modules/cjs/loader:1051
throw err;
^
Error: Cannot find module '/Users/shane/Development.local/nativephp/cronikl/vendor/nativephp/electron/resources/js/php.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
at Module._load (node:internal/modules/cjs/loader:901:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.5.0
Second try on fresh project on a MacPro (x86)...
# Install a new copy of Laravel
laravel new nativephptest
# Change to that directory
cd nativephptest
# Add NativePHP
composer require nativephp/electron
# Run the installer
php artisan native:install
# Build
php artisan native:build
Quick update, if I modify the file vendor/nativephp/electron/src/Commands/BuildCommand.php
line: 36
from:
->run('npm run build:mac-arm', function (string $type, string $output) {
to
->run('npm run build:mac-x86', function (string $type, string $output) {
I can now get it to builld.
I still get the "unlink" error, all perms are correct, even moved into main home directory to be sure.
Error copying PHP binary Error: EPERM: operation not permitted, unlink '/Users/shane/tmp/nativephptest/vendor/nativephp/electron/resources/js/resources/php'
~/tmp/nativephptest ❯ ls -al /Users/me/tmp/nativephptest/vendor/nativephp/electron/resources/js/resources/php
total 46792
drwxr-xr-x 3 me staff 96 27 Jul 19:14 .
drwxr-xr-x 9 me staff 288 27 Jul 19:14 ..
-rwxr-xr-x 1 me staff 23954688 27 Jul 19:14 php
Also, looks like the storage
folder is not linked by default, i.e., need to run php artisan storage:link
@wattsie i think you have an issue with permission
Error copying PHP binary Error: EPERM: operation not permitted, unlink '/Users/me/Development.local/nativephp/nativephptest/vendor/nativephp/electron/resources/js/resources/php'
@wattsie i think you have an issue with permission
Error copying PHP binary Error: EPERM: operation not permitted, unlink '/Users/me/Development.local/nativephp/nativephptest/vendor/nativephp/electron/resources/js/resources/php'
thanks.
I have double checked permissions. I have many (over a hundred) projects in this folder that do not have issues with permissions. I will triple check when I get home again.
Cheers.
I have a different error:
Building for ARM64
/Users/vikas/code/playground/nativephp/vendor/nativephp/electron/bin/arm64/php
=====================
updater config { provider: 'spaces', name: null, region: null, path: null }
=====================
=====================
Copied app to resources
/Users/vikas/code/playground/nativephp/dist
=====================
/bin/sh: /Users/vikas/code/playground/nativephp/vendor/nativephp/php-bin/bin/mac/arm64/php: Bad CPU type in executable
=====================
Error copying app to resources
Error: Command failed: /Users/vikas/code/playground/nativephp/vendor/nativephp/php-bin/bin/mac/arm64/php /Users/vikas/code/playground/nativephp/vendor/nativephp/electron/resources/js/resources/app/artisan native:minify /Users/vikas/code/playground/nativephp/vendor/nativephp/electron/resources/js/resources/app
/bin/sh: /Users/vikas/code/playground/nativephp/vendor/nativephp/php-bin/bin/mac/arm64/php: Bad CPU type in executable
Someone it is identifying my Intel Mac as ARM64.
This should now be fixed with 0.3.0 of the nativephp/electron package 🤞
Where I can get the exported file ?!
The build output can be found in /vendor/nativephp/electron/resources/js/dist in your repo tree...
What happened?
The native:build command doesn't work
How to reproduce the bug
Run the command php artisan native:build
Package Version
current
PHP Version
8.2.0
Laravel Version
10.0.0
Which operating systems does with happen with?
macOS
Notes
No response