diff --git a/Install-gui.ps1 b/Install-gui.ps1 index 5c58788a45..812e6194cc 100644 --- a/Install-gui.ps1 +++ b/Install-gui.ps1 @@ -33,6 +33,16 @@ try { $ErrorActionPreference = "SilentlyContinue" npm ci --loglevel=error npm audit fix + + # Work around Electron's postinstall being silently skipped in the workspaces/ + # hoisted install, which leaves node_modules/electron present but without its + # platform binary (no path.txt). Re-run Electron's own installer if needed. + # Otherwise 'npm run electron' fails with "Electron failed to install correctly". + if (-not (Test-Path "node_modules/electron/path.txt")) { + Write-Output "Electron binary is missing; running Electron's install script." + node node_modules/electron/install.js + } + npm run build py ..\installhelper.py diff --git a/install-gui.sh b/install-gui.sh index 863087fc03..a28195dae7 100755 --- a/install-gui.sh +++ b/install-gui.sh @@ -105,6 +105,16 @@ if [ ! "$CI" ]; then npm ci npm audit fix || true + + # Work around Electron's postinstall being silently skipped in the workspaces/ + # hoisted install, which leaves node_modules/electron present but without its + # platform binary (no path.txt). Re-run Electron's own installer if needed. + # Otherwise `npm run electron` fails with "Electron failed to install correctly". + if [ ! -f node_modules/electron/path.txt ]; then + echo "Electron binary is missing; running Electron's install script." + node node_modules/electron/install.js + fi + npm run build # Set modified output of `chia version` to version property of GUI's package.json