windows中electron,使用electron-builder构建时由于文件过大导致构建失败解决方案

时间:2025-01-26 08:12:37
ExecError: C:\Users\User007\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin\ exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Output: Command line defined: "APP_ID=-project" Command line defined: "APP_GUID=2368610f-177f-5f33-9b73-283da6803b10" Command line defined: "UNINSTALL_APP_KEY=2368610f-177f-5f33-9b73-283da6803b10" Command line defined: "PRODUCT_NAME=showroom" Command line defined: "PRODUCT_FILENAME=showroom" Command line defined: "APP_FILENAME=demo-project" Command line defined: "APP_DESCRIPTION=" Command line defined: "VERSION=1.0.9" Command line defined: "PROJECT_DIR=C:\project\demo-project-web" Command line defined: "BUILD_RESOURCES_DIR=C:\project\demo-project-web\build" Command line defined: "APP_PACKAGE_NAME=demo-project" Command line defined: "APP_64=C:\project\demo-project-web\dist_electron\demo-project-1.0..7z" Command line defined: "APP_64_NAME=demo-project-1.0..7z" Command line defined: "APP_64_HASH=27D7FC29BDA9EB1B72A59F451306CAD4D3C26A1A3B932C4A214589CF377FB715F02242B7602809A904C01B2E787345A8D08ED33215F5421149D70FE730F2D3BC" Command line defined: "APP_PRODUCT_FILENAME=showroom" Command line defined: "APP_INSTALLER_STORE_FILE=demo-project-updater\" Command line defined: "COMPRESSION_METHOD=7z" Command line defined: "ONE_CLICK" Command line defined: "RUN_AFTER_FINISH" Command line defined: "SHORTCUT_NAME=showroom" Command line defined: "UNINSTALL_DISPLAY_NAME=showroom 1.0.9" Command line defined: "ESTIMATED_SIZE=2689691" Command line defined: "COMPRESS=auto" Command line defined: "UNINSTALLER_OUT_FILE=C:\project\demo-project-web\dist_electron\__uninstaller" Processing config: C:\Users\User007\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\ Processing script file: "<stdin>" (ACP) Error output: File: failed creating mmap of "C:\project\demo-project-web\dist_electron\demo-project-1.0..7z" Error in macro x64_app_files on macroline 1 Error in macro compute_files_for_current_arch on macroline 7 Error in macro extractEmbeddedAppPackage on macroline 8 Error in macro installApplicationFiles on macroline 79 !include: error in script: "" on line 63 Error in script "<stdin>" on line 189 -- aborting creation process at ChildProcess.<anonymous> (C:\project\demo-project-web\node_modules\builder-util\src\:250:14) at (node:events:628:26) at (node:events:513:28) at (C:\project\demo-project-web\node_modules\cross-spawn\lib\:34:29) at maybeClose (node:internal/child_process:1100:16) at ._handle.onexit (node:internal/child_process:304:5) { exitCode: 1, alreadyLogged: false, code: 'ERR_ELECTRON_BUILDER_CANNOT_EXECUTE' } error Command failed with exit code 1. info Visit /en/docs/cli/run for documentation about this command.