electron-builder: !include: could not open file: build failed in github action with app-builder-lib

  • Electron-Builder Version: 24.13.3 | 25.0.0-alpha.6
  • Node Version: 20
  • Electron Version: 30.0.0
  • Electron Type (current, beta, nightly): current
  • Target: none
Error output:
!include: could not open file: "...\node_modules\.pnpm\app-builder-lib@25.0.0-alpha.6_dmg-builder@25.0.0-alpha.6_electron-builder-squirrel-windows@2_jamshtybgehbmy77zbhfnvoaye\node_modules\app-builder-lib\templates\nsis\include\StdUtils.nsh"
Error in script "<stdin>" on line 1 -- aborting creation process
  failedTask=build stackTrace=Error: C:\Users\runneradmin\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin\makensis.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 19

Commits related to this issue

Most upvoted comments

Downgrading to 24.13.0 seems to work for us. 24.13.1 is the first version to not work in our case.

Seems to be related to long file paths in Windows. If the working directory is moved closer to root it works with 24.13.3 (shorten the file paths). This is particularly relevant for Windows CI, as runners tend to force a long initial file path before the repo directory, and then absolute paths from there become very long.

We are also using pnpm, so this is potentially an interaction with the tree structure pnpm uses for node_modules.

Same issue:

  • Electron 30.0.1
  • Electron Builder 24.13.3
  • Node 20.12.2
  • PNPM 9.0.2
⨯ C:\Users\runneradmin\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin\makensis.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
Output:
Command line defined: "APP_ID=org.b3log.siyuan"
Command line defined: "APP_GUID=c1e77cb7-68e1-5adb-ab[29](https://github.com/siyuan-note/siyuan/actions/runs/8876860253/job/24369309604#step:19:30)-ecf7379a9944"
Command line defined: "UNINSTALL_APP_KEY=c1e77cb7-68e1-5adb-ab29-ecf7379a9944"
Command line defined: "PRODUCT_NAME=SiYuan"
Command line defined: "PRODUCT_FILENAME=SiYuan"
Command line defined: "APP_FILENAME=SiYuan"
Command line defined: "APP_DESCRIPTION=Refactor your thinking"
Command line defined: "VERSION=3.0.11"
Command line defined: "PROJECT_DIR=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app"
Command line defined: "BUILD_RESOURCES_DIR=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\build"
Command line defined: "APP_PACKAGE_NAME=SiYuan"
Command line defined: "MUI_ICON=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\src\assets\icon.ico"
Command line defined: "MUI_UNICON=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\src\assets\icon.ico"
Command line defined: "APP_64=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\build\SiYuan-3.0.11-x64.nsis.7z"
Command line defined: "APP_64_NAME=SiYuan-3.0.11-x64.nsis.7z"
Command line defined: "APP_64_HASH=3D25DC1177228CB38DB6F6B7A6CA9EDD518574A3894C0E83285642644853E6835E16187458ACF6DC3B4AE55753B50C0D0C79BF788497E52D8F1F9B6A226F3A17"
Command line defined: "APP_64_UNPACKED_SIZE=400874"
Command line defined: "COMPANY_NAME=Yunnan Liandi Technology Co., Ltd."
Command line defined: "MUI_WELCOMEFINISHPAGE_BITMAP=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\nsis\installerSidebar.bmp"
Command line defined: "MUI_UNWELCOMEFINISHPAGE_BITMAP=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\nsis\uninstallerSidebar.bmp"
Command line defined: "ESTIMATED_SIZE=398610"
Command line defined: "COMPRESS=auto"
Command line defined: "BUILD_UNINSTALLER"
Command line defined: "UNINSTALLER_OUT_FILE=D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\build\__uninstaller-nsis-SiYuan.exe"
Processing config: C:\Users\runneradmin\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\nsisconf.nsh
Processing script file: "<stdin>" (UTF8)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Error output:
!include: could not open file: "D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\node_modules\.pnpm\app-builder-lib@24.13.3_dmg-builder@24.13.3_electron-builder-squirrel-windows@24.13.3_dmg-bui_lrspnoputfiosacwyigcypdbdi\node_modules\app-builder-lib\templates\nsis\include\StdUtils.nsh"
Error in script "<stdin>" on line 1 -- aborting creation process
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        at ChildProcess.<anonymous> (D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\node_modules\.pnpm\builder-util@24.13.1\node_modules\builder-util\src\util.ts:252:14)
    at Object.onceWrapper (node:events:633:26)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess.cp.emit (D:\a\siyuan\siyuan\go\src\github.com\siyuan-note\siyuan\app\node_modules\.pnpm\cross-spawn@7.0.3\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:[30](https://github.com/siyuan-note/siyuan/actions/runs/8876860253/job/24369309604#step:19:31)5:5)
 ELIFECYCLE  Command failed with exit code 1.

I’m getting this with 24.13.1 on Windows but 24.13.0 works fine. Using pnpm and Electron v29. I wonder if this is caused by https://github.com/electron-userland/electron-builder/pull/8052…

EDIT: We’re experiencing timeouts of our electron-builder E2Es on Windows when using Electron 30, which may be related. Sticking to Electron 29 and electron-builder@24.13.0 for now.