Closed Nikolas1814 closed 6 years ago
How did you solve your issue?
I removed "main" : "index.js" from my submodule and the problem disappeared
I don't have main in submodule but still throwing the same error. any idea?
I don't have main in submodule but still throwing the same error. any idea? Maybe the value of main is not correct, it should be "./dist/electron/main.js" for example. if deleted, it has the default value of "./index.js".
I was using "files" to "build" entry, forgetting to specify electron-main.js leaded me to this error.
"files": [
"dist/**/*",
"package.json",
"electron-main.js"
]
app.asar必须要有main入口,其实将app.asar解压就会发现其中有background.js,那么我们的package.json中的要设置入口
"main": "background.js",'
app.asar必须要有main入口,其实将app.asar解压就会发现其中有background.js,那么我们的package.json中的要设置入口
"main": "background.js",'
good! thanks for your answer.
Hello to fix this I set:
in vue.config.js
{
pluginOptions: {
electronBuilder: {
builderOptions: {
productName: `MV-Launcher`,
files: [
`dist/**/*`,
`node_modules/**/*`,
`package.json`,
`background.js`
]
}
}
}
}
and in package.json
"main": "background.js",
For me I had to add :
"build": { "asar": true, "files": [ "./dist/**/*" ], "win": {} },
To my package.json.
@ThomasNicolai you may be on an older version if that worked for you:
INFO Building app with electron-builder:
• electron-builder version=22.14.5 os=20.6.0
• loaded configuration file=package.json ("build" field)
• description is missed in the package.json appPackageFile=/Users/runner/work/able/able/dist_electron/bundled/package.json
• author is missed in the package.json appPackageFile=/Users/runner/work/able/able/dist_electron/bundled/package.json
InvalidConfigurationError: 'build' in the application package.json (/Users/runner/work/able/able/dist_electron/bundled/package.json) is not supported since 3.0 anymore. Please move 'build' into the development package.json (/Users/runner/work/able/able/package.json)
at Object.checkMetadata (/Users/runner/work/able/able/node_modules/app-builder-lib/src/util/packageMetadata.ts:78:11)
at Packager.build (/Users/runner/work/able/able/node_modules/app-builder-lib/src/packager.ts:335:5)
at Object.executeFinally (/Users/runner/work/able/able/node_modules/builder-util/src/promise.ts:12:14) {
code: 'ERR_ELECTRON_BUILDER_INVALID_CONFIGURATION'
}
/Users/runner/work/_actions/samuelmeuli/action-electron-builder/v1.6.0/index.js:144
throw err;
^
Error: Command failed: npx --no-install vue-cli-service electron:build --mac --publish always
at checkExecSyncError (child_process.js:635:11)
Please help me to solve this error.
npx electron-builder
• electron-builder version=23.6.0 os=5.4.0-144-generic
• writing effective config file=dist/builder-effective-config.yaml
• packaging platform=linux arch=x64 electron=23.2.0 appOutDir=dist/linux-unpacked
⨯ Application entry file "index.js" in the "/home/njj/dev/electronjs/electron-demo/dist/linux-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration. failedTask=build stackTrace=Error: Application entry file "index.js" in the "/home/njj/dev/electronjs/electron-demo/dist/linux-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration.
at error (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:7:12)
at Object.checkFileInArchive (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:31:11)
at LinuxPackager.checkFileInPackage (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:503:7)
at LinuxPackager.sanityCheckPackage (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:551:5)
at LinuxPackager.doPack (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:312:5)
at LinuxPackager.pack (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:136:5)
at Packager.doBuild (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/packager.ts:441:9)
at Object.executeFinally (/home/njj/dev/electronjs/electron-demo/node_modules/builder-util/src/promise.ts:12:14)
at Packager._build (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/packager.ts:376:31)
at Packager.build (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/packager.ts:337:12)
at Object.executeFinally (/home/njj/dev/electronjs/electron-demo/node_modules/builder-util/src/promise.ts:12:14)
Please help me to solve this error.
npx electron-builder • electron-builder version=23.6.0 os=5.4.0-144-generic • writing effective config file=dist/builder-effective-config.yaml • packaging platform=linux arch=x64 electron=23.2.0 appOutDir=dist/linux-unpacked ⨯ Application entry file "index.js" in the "/home/njj/dev/electronjs/electron-demo/dist/linux-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration. failedTask=build stackTrace=Error: Application entry file "index.js" in the "/home/njj/dev/electronjs/electron-demo/dist/linux-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration. at error (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:7:12) at Object.checkFileInArchive (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:31:11) at LinuxPackager.checkFileInPackage (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:503:7) at LinuxPackager.sanityCheckPackage (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:551:5) at LinuxPackager.doPack (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:312:5) at LinuxPackager.pack (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/platformPackager.ts:136:5) at Packager.doBuild (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/packager.ts:441:9) at Object.executeFinally (/home/njj/dev/electronjs/electron-demo/node_modules/builder-util/src/promise.ts:12:14) at Packager._build (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/packager.ts:376:31) at Packager.build (/home/njj/dev/electronjs/electron-demo/node_modules/app-builder-lib/src/packager.ts:337:12) at Object.executeFinally (/home/njj/dev/electronjs/electron-demo/node_modules/builder-util/src/promise.ts:12:14)
try set {"extends": null}
, this works for me
app.asar必须要有main入口,其实将app.asar解压就会发现其中有background.js,那么我们的package.json中的要设置入口
"main": "background.js",'
good! thanks for your answer.
设置完报错: ⨯ Application entry file "background.js" in the "D:\myCode\Smart-Mining\dist\win-unpacked\resources\app.asar" does not exist. Seems like a wrong configuration. failedTask=build stackTrace=Error: Application entry file "background.js" in the "D:\myCode\Smart-Mining\dist\win-unpacked\resources\app.asar" does not exist. Seems like a wrong configuration. at error (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\asar\asarFileChecker.ts:7:12) at checkFileInArchive (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\asar\asarFileChecker.ts:31:11) at WinPackager.checkFileInPackage (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\platformPackager.ts:514:7) at WinPackager.sanityCheckPackage (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\platformPackager.ts:562:5) at WinPackager.doPack (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\platformPackager.ts:319:5) at WinPackager.pack (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\platformPackager.ts:140:5) at Packager.doBuild (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\packager.ts:445:9) at executeFinally (D:\myCode\Smart-Mining\node_modules\builder-util\src\promise.ts:12:14) at Packager._build (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\packager.ts:379:31) at Packager.build (D:\myCode\Smart-Mining\node_modules\app-builder-lib\src\packager.ts:340:12) at executeFinally (D:\myCode\Smart-Mining\node_modules\builder-util\src\promise.ts:12:14)
My electron version is 19.53.7 and I am building for linux(x64) The error I get is _Error: Application entry file "index.js" in the "/home/nikolas/Documents/ora-app/dist/linux-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration. at error (/home/nikolas/Documents/ora-app/nodemodules/electron-builder-lib/src/asar/asarFileChecker.ts:7:12)
The output of this command asar.js list app.asar is:
/LICENSE.md /README.md /index.html /main.js
My main package.json:and the once in my app: