electron-builder 打包 exe 异常错误集锦

这篇具有很好参考价值的文章主要介绍了electron-builder 打包 exe 异常错误集锦。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

项目技术

vue-electron

vue-router

vuex

vuex-electron

element-ui

echarts

mysql

打包异常

Error: Unresolved node modules: vue
Error: Unresolved node modules: vue
    at D:\Code\Demo\Vue\Voice\App\node_modules\_app-builder-lib@20.44.4@app-builder-lib\src\util\packageDependencies.ts:112:21
    at Generator.next (<anonymous>)
    at Generator.tryCatcher (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\util.js:16:23)
    at PromiseSpawn._promiseFulfilled (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\generators.js:97:49)
    at Promise._settlePromise (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:609:26)
    at Promise._settlePromise0 (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:729:18)
    at Promise._fulfill (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:673:18)
    at Promise._resolveCallback (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:466:57)
    at Promise._settlePromiseFromHandler (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:559:17)
    at Promise._settlePromise (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:604:18)
    at Promise._settlePromises (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\promise.js:725:18)
From previous event:
    at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\debuggability.js:482:19)
    at new PromiseSpawn (D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\generators.js:43:17)
    at D:\Code\Demo\Vue\Voice\App\node_modules\_bluebird@3.7.2@bluebird\js\release\generators.js:197:21
    at Packager.build (D:\Code\Demo\Vue\Voice\App\node_modules\_app-builder-lib@20.44.4@app-builder-lib\src\packager.ts:288:14)
    at build (D:\Code\Demo\Vue\Voice\App\node_modules\_app-builder-lib@20.44.4@app-builder-lib\src\index.ts:59:28)
    at build (D:\Code\Demo\Vue\Voice\App\node_modules\_electron-builder@20.44.4@electron-builder\src\builder.ts:228:10)
    at D:\Code\Demo\Vue\Voice\App\node_modules\_electron-builder@20.44.4@electron-builder\src\cli\cli.ts:49:19

可能是使用淘宝镜像的问题,把项目内 node_modules 文件夹内所有内容清除掉,然后使用 yarn install 重新下载。

Error: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)
Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)
From previous event:
    at CancellationToken.createPromise (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util-runtime\src\CancellationToken.ts:51:12)
    at D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\nodeHttpExecutor.ts:23:44
From previous event:
    at NodeHttpExecutor.download (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\out\nodeHttpExecutor.js:144:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\binDownload.ts:72:26
    at Generator.next (<anonymous>)
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at doGetBin (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\out\binDownload.js:74:21)
    at getBin (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\binDownload.ts:30:13)
    at getTool (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\targets\tools.ts:118:10)
    at getAppBuilderTool (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\targets\tools.ts:128:3)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\platformPackager.ts:586:40
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.resolveIcon (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\platformPackager.js:623:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\platformPackager.ts:560:26
    at Generator.next (<anonymous>)
    at WinPackager.getOrConvertIcon (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\platformPackager.js:594:11)
    at Lazy.<anonymous> (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:59:43)
    at Lazy.get value [as value] (D:\Code\Demo\Vue\Voice\App\node_modules\lazy-val\src\main.ts:18:25)
    at WinPackager.getIconPath (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:195:27)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:292:33
    at Generator.next (<anonymous>)
    at WinPackager.signAndEditResources (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\winPackager.js:405:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:343:18
From previous event:
    at WinPackager.getOrConvertIcon (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\platformPackager.js:594:11)
    at Lazy.<anonymous> (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:59:43)
    at Lazy.get value [as value] (D:\Code\Demo\Vue\Voice\App\node_modules\lazy-val\src\main.ts:18:25)
    at WinPackager.getIconPath (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:195:27)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:292:33
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.signAndEditResources (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\winPackager.js:405:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:343:18
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.signApp (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\winPackager.js:423:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\platformPackager.ts:209:16
    at Generator.next (<anonymous>)
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at WinPackager.doPack (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\platformPackager.js:276:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\platformPackager.ts:113:16
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.pack (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\platformPackager.js:196:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\packager.ts:364:24
    at Generator.next (<anonymous>)
    at D:\Code\Demo\Vue\Voice\App\node_modules\fs-extra-p\node_modules\fs-extra\lib\mkdirs\mkdirs.js:56:16
    at callback (D:\Code\Demo\Vue\Voice\App\node_modules\graceful-fs\polyfills.js:299:20)
    at FSReqCallback.oncomplete (fs.js:184:5)
From previous event:
    at Packager.doBuild (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\packager.js:432:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\packager.ts:308:52
    at Generator.next (<anonymous>)
    at D:\Code\Demo\Vue\Voice\App\node_modules\graceful-fs\graceful-fs.js:144:16
    at D:\Code\Demo\Vue\Voice\App\node_modules\graceful-fs\graceful-fs.js:61:14
    at FSReqCallback.oncomplete (fs.js:171:23)
From previous event:
    at Packager._build (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\packager.js:376:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\packager.ts:270:23
    at Generator.next (<anonymous>)
From previous event:
    at Packager.build (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\packager.js:332:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\builder.ts:310:40
    at Generator.next (<anonymous>)
From previous event:
    at _build (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\out\builder.js:61:21)
    at build (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\builder.ts:280:10)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\cli\cli.ts:48:33
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at Object.runCommand (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\node_modules\yargs\lib\command.js:235:44)
    at Object.get [as argv] (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\node_modules\yargs\yargs.js:965:21)
    at Object.<anonymous> (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\cli\cli.ts:42:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

electron-builder 版本问题,需要将 20.0 的版本降低到 "electron-builder": "^19.19.1" 。
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
From previous event:
    at CancellationToken.createPromise (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util-runtime\src\CancellationToken.ts:51:12)
    at D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\nodeHttpExecutor.ts:23:44
    at Generator.next (<anonymous>)
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at NodeHttpExecutor.download (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\out\nodeHttpExecutor.js:144:11)
    at Timeout._onTimeout (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\binDownload.ts:83:14)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
 

下载请求超时,注意报错的前两句:
downloading     path=C:\Users\***\AppData\Local\electron-builder\cache\nsis\nsis-3.0.1.13 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.1.13/nsis-3.0.1.13.7z
cannot download: Error: read ECONNRESET path=C:\Users\***\AppData\Local\electron-builder\cache\nsis\nsis-3.0.1.13 attempt=1
说明在下载 nsis-3.0.1.13.7z 这个压缩包时连接超时,这时需要我们手动下载(直接浏览器打开:https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.1.13/nsis-3.0.1.13.7z)这个安装包放到指定文件夹: C:\Users\***\AppData\Local\electron-builder\cache\nsis\ 下面(如下图)

at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
From previous event:
    at CancellationToken.createPromise (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util-runtime\src\CancellationToken.ts:51:12)
    at D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\nodeHttpExecutor.ts:23:44
    at Generator.next (<anonymous>)
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at NodeHttpExecutor.download (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\out\nodeHttpExecutor.js:144:11)
    at Timeout._onTimeout (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\binDownload.ts:83:14)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
同样的问题,下载超时,注意前两句:
downloading     path=C:\Users\PLS_01\AppData\Local\electron-builder\cache\nsis-resources\nsis-resources-3.3.0 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z
cannot download: Error: read ECONNRESET path=C:\Users\PLS_01\AppData\Local\electron-builder\cache\nsis-resources\nsis-resources-3.3.0 attempt=1
处理办法如上
Error: Exit code: 1. Command failed: C:\Users\***\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-1.9.0\rcedit.exe D:\Code\Demo\Vue\Voice\App\build\win-unpacked\app.exe --set-version-string FileDescription app --set-version-string ProductName app --set-version-string LegalCopyright Copyright © 2021 *** --set-file-version 0.0.1 --set-product-version 0.0.1.0 --set-version-string InternalName app --set-version-string OriginalFilename  --set-version-string CompanyName ***
--set-icon D:\Code\Demo\Vue\Voice\App\build\icons\icon.ico
Error: Exit code: 1. Command failed: C:\Users\***\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-1.9.0\rcedit.exe D:\Code\Demo\Vue\Voice\App\build\win-unpacked\app.exe --set-version-string FileDescription app --set-version-string ProductName app --set-version-string LegalCopyright Copyright © 2021 *** --set-file-version 0.0.1 --set-product-version 0.0.1.0 --set-version-string InternalName app --set-version-string OriginalFilename  --set-version-string CompanyName *** 
--set-icon D:\Code\Demo\Vue\Voice\App\build\icons\icon.ico
Fatal error: Unable to commit changes
 
Fatal error: Unable to commit changes
 
    at D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\util.ts:122:16
    at ChildProcess.exithandler (child_process.js:315:5)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
From previous event:
    at exec (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\util.ts:85:3)
    at execWine (D:\Code\Demo\Vue\Voice\App\node_modules\builder-util\src\wine.ts:60:12)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:326:11
From previous event:
    at WinPackager.signAndEditResources (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\winPackager.js:405:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\winPackager.ts:343:18
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.signApp (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\winPackager.js:423:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\platformPackager.ts:209:16
    at Generator.next (<anonymous>)
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at WinPackager.doPack (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\platformPackager.js:276:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\platformPackager.ts:113:16
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.pack (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\platformPackager.js:196:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\packager.ts:364:24
    at Generator.next (<anonymous>)
    at D:\Code\Demo\Vue\Voice\App\node_modules\fs-extra-p\node_modules\fs-extra\lib\mkdirs\mkdirs.js:56:16
    at callback (D:\Code\Demo\Vue\Voice\App\node_modules\graceful-fs\polyfills.js:299:20)
    at FSReqCallback.oncomplete (fs.js:184:5)
From previous event:
    at Packager.doBuild (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\packager.js:432:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\packager.ts:308:52
    at Generator.next (<anonymous>)
    at D:\Code\Demo\Vue\Voice\App\node_modules\graceful-fs\graceful-fs.js:144:16
    at D:\Code\Demo\Vue\Voice\App\node_modules\graceful-fs\graceful-fs.js:61:14
    at FSReqCallback.oncomplete (fs.js:171:23)
From previous event:
    at Packager._build (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\packager.js:376:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\src\packager.ts:270:23
    at Generator.next (<anonymous>)
From previous event:
    at Packager.build (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder-lib\out\packager.js:332:11)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\builder.ts:310:40
    at Generator.next (<anonymous>)
From previous event:
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\builder.ts:310:40
    at Generator.next (<anonymous>)
From previous event:
    at build (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\builder.ts:280:10)
    at D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\cli\cli.ts:48:33
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at Object.handler (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\cli\cli.ts:48:33)
    at Object.runCommand (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\node_modules\yargs\lib\command.js:235:44)
    at Object.parseArgs [as _parseArgs] (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\node_modules\yargs\yargs.js:1050:24)
    at Object.get [as argv] (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\node_modules\yargs\yargs.js:965:21)
    at Object.<anonymous> (D:\Code\Demo\Vue\Voice\App\node_modules\electron-builder\src\cli\cli.ts:42:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)

是因为项目没有配置 nsis ,在 package.json 下 的 build 中新增 nsis 配置:
"build": {
    "nsis": {
      "oneClick": false, // 是否一键安装
      "allowElevation": true, // 允许请求提升。 如果为false,则用户必须使用提升的权限重新启动安装程序。
      "allowToChangeInstallationDirectory": true, // 允许修改安装目录
      "installerIcon": "./build/icons/aaa.ico",// 安装图标
      "uninstallerIcon": "./build/icons/bbb.ico",//卸载图标
      "installerHeaderIcon": "./build/icons/aaa.ico", // 安装时头部图标
      "createDesktopShortcut": true, // 创建桌面图标
      "createStartMenuShortcut": true,// 创建开始菜单图标
      "shortcutName": "xxxx" // 图标名称
    }
}
至此,成功打包,在项目 build 文件下可以看到一个 exe 安装包。
————————————————
版权声明:本文为CSDN博主「蜡笔小新历险记」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/muyoufansem/article/details/115068814文章来源地址https://www.toymoban.com/news/detail-628072.html

到了这里,关于electron-builder 打包 exe 异常错误集锦的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Electron-builder打包vue项目后,背景图片不加载的问题

    打包后的项目启动之后,背景图片没有成功加载,只有一片空白。此时打开调试工具可以看到,electron自动把图片路径加上了/img/  我们这时打开打包后的dist_electron文件夹,打开bundledimg目录,  这就是上面报错的路径。 对于背景图片,不要使用如下 background:url(\\\'..\\\') 的形式,这样写

    2024年02月09日
    浏览(45)
  • electron-build打包报错:ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

    electron-build,windows平台打包过程经常报错 : Error: C:UsersM******_C******AppDataLocalelectron-builderCachensisnsis-3.0.3.2Binmakensis.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE at ChildProcess. (H:SaveLanenode_modulesbuilder-utilsrcutil.ts:239:14) at Object.onceWrapper (events.js:422:26) at ChildProcess.emit (events.j

    2024年02月11日
    浏览(42)
  • eletron+react+antd+node开发桌面小程序并打包(electron-packager+electron-builder)

    首先罗列一下项目中用到的技术: electron, react,antd, typescript, node,及打包命令:pkg,electron-packager,electron-builder及child_process实现多进程 需求:开发一个桌面应用,左侧展示视频(需要用到node服务进行rtsp转码),右侧一些获取视频流需要的表单数据。 因为从需求到完成小

    2024年02月11日
    浏览(43)
  • Electron-Builder Windows系统代码签名

    项目打包签名是两年前做的了,使用Electron-Bulder,打包工具版本迭代较少,倒是electron版本更新飞快,目前官方推荐使用Electron Forge进行打包,后续再对两者进行对比,重新整理现在的实现方案。 在Windows系统中,如果程序没有代码签名证书,或者代码签名授信级别较低时,系

    2024年02月06日
    浏览(37)
  • Electron从构建到打包exe应用

    创建一个文件夹,在根目录执行以下几个命令 然后运行根目录执行命令npm run start 可以在命令行中看到hellow!!,此时项目算是跑通了 1.根目录新增index.html文件,写添加html的默认代码等标签,并添加一个hellow 2.根目录新增main.js 运行npm start ,会打开一个浏览器窗口 1.根目录新加新

    2024年02月15日
    浏览(42)
  • 使用Electron打包vue文件变成exe应用程序

    克隆下载Electron: 链接: electron-quick-start 1.下载之后安装Electron依赖 npm安装electron总失败使用下面的安装方式 2.安装打包运行 代码如下(示例): 代码如下(示例): 代码如下(示例): 打包后得路径修改成为./,避免Electron打包exe后显示空白 修改生产环境配置,配置为后端

    2024年01月24日
    浏览(48)
  • 【Electron将HTML项目打包成桌面应用exe文件】

    1、初始化 此时项目多出一个package.json文件。 2、在根目录下新建main.js 3、安装electron 4、配置package的js文件 5、打包执行以下命令,此时会输出文件夹/out,找到exe文件就是打包程序的快捷方式,但是还没结束。我们只是通过electron-packager,将electron应用打包成可执行exe,我们还

    2024年02月10日
    浏览(40)
  • Electron+Vue3+TS 打包exe客户端

    Electron + Vue3 + TS 实战 - 掘金 如果报错loaderContext.getOptions is not a function ts-loader版本不一致导致的问题。 解决方案:npm install ts-loader@8.0.0 --save

    2024年02月11日
    浏览(35)
  • 已经打包好了的vue dist文件夹,如何用electron打包成exe桌面应用

    先在项目根目录下(非dist根目录)安装electron electron-packager 再在项目根目录下(非dist根目录)安装electron-packager 然后在dist文件夹下创建main.js文件,内容为 再创建一个文件package.json 在非dist文件夹(注意,是非dist文件夹,就是原本没打包的项目文件里)的package.json文件里,改

    2024年02月19日
    浏览(55)
  • electron项目打包之后显示空白页面以及发送http请求地址错误

            electron项目在开发阶段,因为使用webpack脚手架,启用了webServer提供的http服务,所以有路由功能,当我们运行npm run electron:serve的时候,最后可以直接加载http://localhost:8080。在app里面就可以显示页面。     当electron项目打包之后,成为桌面程序,这个时候就没有http服务支

    2024年02月13日
    浏览(36)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包