You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Electron项目生成Debian安装包时遇二进制文件找不到错误求助

Hey there, let's sort out that deb packaging error you're hitting with your Electron app! That Error: could not find the Electron app binary at "dist/app-linux-x64/koriwallet" message is telling us that electron-installer-debian can't locate your app's executable file in the path you specified, and it's because of a mismatch between your packaging setup and the deb builder's expectations. Let's break down the fixes:

First, understand the root cause

Looking at your package.json:

  • Your electron-packager build script is electron-packager . myapp, which generates a folder named myapp-linux-x64 inside dist/ (not app-linux-x64 like your deb64 script references).
  • You've set "executableName": "kori" in electronPackagerConfig, so your app's binary is named kori — not koriwallet which the deb installer is looking for by default.

Fix Option 1: Tweak electron-packager + electron-installer-debian setup

You have two sub-options here to align the paths and filenames:

Sub-option 1a: Match the deb installer's expected binary name

Update your build script to name your packaged app and binary koriwallet directly:

"scripts": {
  "build": "electron-packager . koriwallet --out dist"
}

This will generate dist/koriwallet-linux-x64/koriwallet, which matches what the deb installer expects. Then update your deb64 script to point to the correct folder:

"deb64": "electron-installer-debian --src dist/koriwallet-linux-x64/ --dest dist/installers/ --arch amd64"

Run npm run build first, then npm run deb64 to generate your deb file.

Sub-option 1b: Keep your custom executable name

If you want to keep the binary named kori, just tell electron-installer-debian exactly where to find it with the --bin flag:

"deb64": "electron-installer-debian --src dist/myapp-linux-x64/ --dest dist/installers/ --arch amd64 --bin kori"

Again, run npm run build followed by npm run deb64 to get your deb package.

You already have electron-builder installed, and it can handle deb packaging natively — no need for electron-installer-debian at all. This is simpler and less error-prone:

  1. Update your build configuration and dist script in package.json:
"scripts": {
  "dist": "electron-builder --linux deb"
},
"build": {
  "appId": "com.yourdomain.koriwallet", // Use a reverse-domain style ID for best practices
  "linux": {
    "category": "Finance", // More accurate category for a wallet app
    "target": "deb",
    "executableName": "koriwallet" // Set your desired binary name here
  }
}
  1. Run npm run dist — electron-builder will handle the entire packaging process and drop your amd64 deb file right into the dist folder.

Pro tip: Before re-running any packaging commands, delete the dist folder to clear out old cached files that might cause conflicts.

内容的提问来源于stack exchange,提问作者Suman Raj

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 09:19:08