提问人:huhu 提问时间:8/1/2023 最后编辑:matiaslauritihuhu 更新时间:8/6/2023 访问量:232
无法为 nativephp 应用程序提供服务
Unable to serve nativephp application
问:
我正在使用 Laravel 10.16.1 和 MacOS。我一直在尝试第一次使用我的 nativePHP 应用程序,但我收到以下错误:php artisan native:serve
Starting NativePHP dev server…
Fetching latest dependencies…
Starting NativePHP app…
ErrorException
file_get_contents(/home/user/processApp-native/vendor/nativephp/electron/src/Commands/../../resources/js/node_modules/electron/dist/Electron.app/Contents/Info.plist): Failed to open stream: No such file or directory
at vendor/nativephp/electron/src/Commands/DevelopCommand.php:65
61▕ * @return void
62▕ */
63▕ protected function patchPlist()
64▕ {
➜ 65▕ $pList = file_get_contents(__DIR__.'/../../resources/js/node_modules/electron/dist/Electron.app/Contents/Info.plist');
66▕
67▕ // Change the CFBundleName to the correct app name
68▕ $pattern = '/(<key>CFBundleName<\/key>\s+<string>)(.*?)(<\/string>)/m';
69▕ $pList = preg_replace($pattern, '$1'.config('app.name').'$3', $pList);
+14 vendor frames
15 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))'
答:
0赞
huhu
8/3/2023
#1
原来我需要在命令运行之前使用sudo
$ sudo php artisan native:serve
评论
0赞
A.L
8/6/2023
你知道为什么需要超级用户访问权限吗?使用此命令,可能会改变您的系统。artisan
artisan
评论
native:install
了吗?