system Version: mac os 10.12.4
Target: win x64
I use two package.json to build project.
Directory structure:
โโโ app
โย ย โโโ config.js
โย ย โโโ index.js
โย ย โโโ lib
โย ย โโโ node_modules
โย ย โโโ package.json
โย ย โโโ plugins
โย ย โโโ resources
โโโ package.json
(root)package.json:
{
"scripts": {
"build:win64": "build --win --x64"
},
"devDependencies": {
"electron": "^1.6.10"
},
"main": "./app/index.js",
"build": {
"asar": true,
"appId": "com.zwm.demo",
"copyright": "zwm",
"productName": "zwm",
"files": "./app/**/*",
"win": {
"icon": "./app/resources/images/l.ico"
}
}
}
app/package.json:
{
"name": "ep",
"packageName": "ep",
"releaseName": "ep",
"version": "1.0.0",
"description": "pc",
"main": "./index.js",
"scripts": {
"start": "electron ."
},
"author": "zhouweiming <[email protected]>",
"license": "ISC",
"dependencies": {},
"devDependencies": {
"electron": "^1.6.10"
}
}
build errors:
electron-builder 18.3.5
Skip app dependencies rebuild because platform is different
Packaging for win32 x64 using electron 1.6.10 to dist/win-unpacked
Error: Application entry file "index.js" in the "/Users/zhouweiming/data/project/iermu_pc_app/dist/win-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration.
at error (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/src/asarUtil.ts:380:12)
at /usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/src/asarUtil.ts:406:11
at Generator.next (<anonymous>)
at Generator.tryCatcher (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/generators.js:97:49)
at Promise._settlePromise (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/promise.js:574:26)
at Promise._settlePromise0 (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/promise.js:614:10)
at Promise._settlePromises (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/promise.js:693:18)
at Async._drainQueue (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/async.js:133:16)
at Async._drainQueues (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/async.js:17:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/debuggability.js:397:19)
at new PromiseSpawn (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/generators.js:43:17)
at /usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/js/release/generators.js:197:21
at build (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/out/builder.js:70:21)
at Object.<anonymous> (/usr/local/lib/node_modules/.electron-builder_npminstall/node_modules/[email protected]/out/cli/build-cli.js:71:41)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:538:3
asar list app.asar:
/package.json
I have found a lot of similar problems and solutions in the issues, but I have not solved my problem.
Please help me.
I see the same error with our single package.json project when I add something to the files array. It happens to be a directory in my case and I've tried just the directory name, the directory name with a trailing slash, the directory name with a leading ./, and the directory name with both a leading ./ and a trailing slash with either single or double asterisk.
We are on an older version of electron-builder (17.1.1).
@zhouweiming I notice your "files": is not an array. Have you tried, "files": [ "app" ], ?
./ prefix not supported โ will be fixed, but for now please just use without.
As stated, files relative to app directory. Please see docs. If you use two package structure โ no need to specify files, only your app dir will be packed, as default pattern */**
@develar I apologize for bumping this so far in the distant future but I had to inform you that you just pulled me out of a 16-hour-long stretch of misery and suffering. OMG. I removed the files: [ "foobar", "etc" ] configuration parameter and _BOOM_ it built on the first try!!! THANK YOU THANK YOU THANK YOU THANK YOU
Most helpful comment
As stated, files relative to app directory. Please see docs. If you use two package structure โ no need to specify files, only your app dir will be packed, as default pattern
*/**