- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What were you trying to do?
had an issue with the nativephp desktop after switching to 2.0.2... (from 2.0)
here is the issues i had:
php artisan native:install
 ┌ Would you like to publish the Electron project? ─────────────┐
 │ No                                                           │
 └──────────────────────────────────────────────────────────────┘
 ┌ Would you like to install the NativePHP NPM dependencies? ───┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘
 Installing NPM dependencies (This may take a while)...
 Installing NPM dependencies using the npm package manager...
> nativephp@v2 postinstall
> node ./node_modules/electron-builder/cli.js install-app-deps
  • electron-builder  version=25.1.8
  • executing @electron/rebuild  electronVersion=38.3.0 arch=arm64 buildFromSource=false appDir=./
  • installing native dependencies  arch=arm64
  • completed installing native dependencies
up to date, audited 1003 packages in 2s
197 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities
  Installing composer scripts 
 Installing `composer native:dev` script alias...
 native:dev script already installed... skipping.
 Installing `native:install --publish` post-update-cmd script
 `native:install --publish` script already present in post-update-cmd... skipping.
  Publishing NativePHP Service Provider... 
   INFO  Publishing [nativephp-provider] assets.  
  File [app/Providers/NativeAppServiceProvider.php] already exists ......................................................................... SKIPPED  
   INFO  Publishing [nativephp-config] assets.  
  File [config/nativephp.php] already exists ............................................................................................... SKIPPED  
 ┌ Would you like to start the NativePHP development server ────┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘
  Starting NativePHP dev server… 
 Fetching latest dependencies…
 Installing NPM dependencies (This may take a while)...
 Installing NPM dependencies using the npm package manager...
> nativephp@v2 postinstall
> node ./node_modules/electron-builder/cli.js install-app-deps
  • electron-builder  version=25.1.8
  • executing @electron/rebuild  electronVersion=38.3.0 arch=arm64 buildFromSource=false appDir=./
  • installing native dependencies  arch=arm64
  • completed installing native dependencies
up to date, audited 1003 packages in 2s
197 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities
 Starting NativePHP app
   ErrorException 
  file_get_contents(/Users/christophe/XXXXXX/vendor/nativephp/desktop/resources/electron/node_modules/electron/dist/Electron.app/Contents/Info.plist): Failed to open stream: No such file or directory
  at vendor/nativephp/desktop/src/Drivers/Electron/Commands/RunCommand.php:75
     71▕      * during development.
     72▕      */
     73▕     protected function patchPlist(): void
     74▕     {
  ➜  75▕         $pList = file_get_contents(ElectronServiceProvider::electronPath('node_modules/electron/dist/Electron.app/Contents/Info.plist'));
     76▕ 
     77▕         // Change the CFBundleName to the correct app name
     78▕         $pattern = '/(<key>CFBundleName<\/key>\s+<string>)(.*?)(<\/string>)/m';
     79▕         $pList = preg_replace($pattern, '$1'.config('app.name').'$3', $pList);
      +26 vendor frames 
  27  artisan:16
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))
i did a --force and deleted the vendor and node content but the issue was still present, i think the issue is linked to the npm that was not built correctly
with this:
cd vendor/nativephp/desktop/resources/electron && npm install -> was ok
What happened?
file_get_contents(/Users/christophe/XXXXXX/vendor/nativephp/desktop/resources/electron/node_modules/electron/dist/Electron.app/Contents/Info.plist): Failed to open stream: No such file or directory
at vendor/nativephp/desktop/src/Drivers/Electron/Commands/RunCommand.php:75
How to reproduce the bug
No sure if it's linked to my setup or an upgrade issue
Debug Output
Array
(
    [Environment] => Array
        (
            [PHP] => Array
                (
                    [Version] => 8.3.27
                    [Path] => /Users/christophe/Library/Application Support/Herd/bin/php83
                )
            [Laravel] => Array
                (
                    [Version] => 12.20.0
                    [ConfigCached] => 
                    [RoutesCached] => 1
                    [DebugEnabled] => 
                )
            [Node] => Array
                (
                    [Version] => v22.19.0
                    [Path] => /Users/christophe/Library/Application Support/Herd/config/nvm/versions/node/v22.19.0/bin/node
                )
            [NPM] => Array
                (
                    [Version] => 10.9.3
                    [Path] => /Users/christophe/Library/Application Support/Herd/config/nvm/versions/node/v22.19.0/bin/npm
                )
            [OperatingSystem] => Darwin
        )
    [NativePHP] => Array
        (
            [Versions] => Illuminate\Support\Collection Object
                (
                    [items:protected] => Array
                        (
                            [nativephp/desktop] => 2.0.2.0
                            [nativephp/php-bin] => 1.1.1.0
                        )
                    [escapeWhenCastingToString:protected] => 
                )
            [Configuration] => Array
                (
                    [Provider] => App\Providers\NativeAppServiceProvider
                    [BuildHooks] => Array
                        (
                            [Pre] => Array
                                (
                                    [0] => npm run build
                                )
                            [Post] => Array
                                (
                                )
                        )
                    [NotarizationEnabled] => 
                    [AzureTrustedSigningEnabled] => 
                    [CustomPHPBinary] => 
                )
        )
)
  Debug Information Generated. 
Which operating systems have you seen this occur on?
macOS
Notes
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working