正文已经按 「Electron ABI 版本对照表」、「&x20;问题解答」、「&x20;==The process cannot access the file because it is being used by another process.==」、「&x20;==d3dcompiler\47.dll: Access is denied.==」 等小节组织,阅读时可以先定位到当前问题对应的小节。
==The process cannot access the file because it is being used by another process.==​
[x] 一般是应为当前项目被编辑器打开某个进程或者文件被占用
1 2 3 4 5 6 7 8 9 10 11
⨯ remove F:\**\vvvvv\release\win-unpacked\resources\app.asar: The process cannot access the file because it is being used by another process. github.com/develar/go-fs-util.EnsureEmptyDir /Volumes/data/go/pkg/mod/github.com/develar/go-fs-util@v0.0.0-20190620175131-69a2d4542206/fs.go:98 github.com/develar/app-builder/pkg/electron.UnpackElectron.func1.1 /Volumes/data/Documents/app-builder/pkg/electron/electronUnpack.go:38 github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2 /Volumes/data/Documents/app-builder/pkg/util/async.go:68 runtime.goexit /usr/local/Cellar/go/1.17/libexec/src/runtime/asm_amd64.s:1581 ⨯ F:\lancema\study\vvf3\node_modules\.pnpm\app-builder-bin@4.0.0\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code:
VM4 sandbox_bundle:2 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security Policy set or a policy with"unsafe-eval" enabled. This exposes users of this app to unnecessary security risks.
For more information and help, consult https://electronjs.org/docs/tutorial/security. This warning will not show up once the app is packaged.
==A JavaScript error occurred in the main processlJncaught Exception:E rror: Cannot find module 'xxxxx'Req 如果在开发模式正常编译打包后打开软件后出现,应该是【electron-builder】在打包出现问题不知道是设置的问题还是其它问题,目前的解决方法是按照提示错误依次在devDependencies中安装依赖库==​
1
A JavaScript error occurred in the main processlJncaught Exception:E rror: Cannot find module '@serialport/parser-byte-length'Req u i re stack:F:\Iancema\study\vvf3\reIease\win-unpacked\resources\app.asar\node mod...\indexjsat M0duIe. resolvefilename (node:internal/modules/cjs/loader:1151 : 15 )at s. resolvefilename (node:eIectron/js2c/browser init:2:120278 )at M0duIe. load (n0de:internaI/m0dules/cjs/loader:992:27)at c. load (node:eIectron/js2c/node init:2:13672 )at M0duIe.require (node:internal/modules/cjs/loader:1242 : 19 )at req u i re (node:internal/modules/helpers:176 : 18 )at Object.<anonymous>
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again ​
D:\lancema\studies\electron-spider\node_modules\.pnpm\electron@33.4.4\node_modules\electron\index.js:17 thrownewError('Electron failed to install correctly, please delete node_modules/electron and try installing again'); ^
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again at getElectronPath (D:\lancema\studies\electron-spider\node_modules\.pnpm\electron@33.4.4\node_modules\electron\index.js:17:11) at Object.<anonymous> (D:\lancema\studies\electron-spider\node_modules\.pnpm\electron@33.4.4\node_modules\electron\index.js:21:18) at Module._compile (node:internal/modules/cjs/loader:1734:14) at Object..js (node:internal/modules/cjs/loader:1899:10) at Module.load (node:internal/modules/cjs/loader:1469:32) at Function._load (node:internal/modules/cjs/loader:1286:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:235:24) at cjsLoader (node:internal/modules/esm/translators:311:5) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:204:7)
Node.js v23.8.0 ELIFECYCLE Command failed with exit code 1.
进入到node_modules\electron 目录后, 执行 node install.js
Error: Could not locate the bindings file. Tried: ​