Error after electron packaging: spawn exe enoent error solution.
Today, an error occurred when the project was running after packaging: spawn exe enoent error. When looking for a solution, I thought it should be that the referenced exe program was packaged into the app It is caused by the ASAR file, so the EXE file is not packaged into the app ASAR files should solve the problem.
I packed it with electron builder in Vue config.JS file, in Vue config.JS add the following code
pluginOptions: {
electronBuilder: {
builderOptions: {
asar: true,
asarUnpack: ['exeFiles'],//The folder where the referenced dll/exe files are stored
extraFiles: {
from: 'exeFiles',// the folder where the referenced dll/exe files are stored, my project is in the same directory as vue.config.js
to: '. /exeFiles'//the location of the folder after packaging, I packaged this way before and after the reference relationship does not change, spawn code will not have to change
},
}
}
If you use the older version of Vue cli, it should be in package JSON, the principle is similar.
Read More:
- [Solved] electron Package and Startup Error: Error: ENOENT: no such file or directory, open ‘xxx/manifest.json‘‘
- [Solved] Error spawn CMD enoent errno when starting Vue project: – 4058
- [Solved] Temporary error: Error: spawn E:\vue3-vite\my-app\node_modules\esbuild\esbuild.exe ENOENT
- [Solved] electron-vue project error: Object.fromEntries is not a function electron-vue
- [Solved] Failed to Create Vue Scaffold Error: spawn yarn ENOENT
- [Solved] Vue project configurate test environment and package error
- [Solved] electron Use remote Error: Cannot read properties of undefined (reading ‘BrowserWindow‘)
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- [Solved] Project Package Error: Javascript heap out of memory
- [Solved] electron Error: Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
- Vue Package Image Error: Syntax Error: Error: ‘**\node_modules\pngquant-bin\vendor\pngquant.exe‘
- [Solved] Uncaught Error: @electron/remote is disabled for this WebContents
- How to Solve electron import page Error
- [Solved] Error: ENOENT: no such file or directory, scandir ‘..\node_modules\node-sass\vendor‘
- [Solved] VUE npm install Error: Module build failed: Error: ENOENT: no such file or directory, scandir
- [Solved] Msbuild: error msb3428: the group cannot use the visual c + + function “vcbuild. Exe”.
- [Solved] MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe“
- [Solved] Vuepress Package Error: document is not defined
- [Solved] vite package Error: globalThis is not defined
- [Solved] Vue Use gzip Package Error: Rule can only have one resource source