You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Electron 25.3.0打包程序在Windows Server 2008 R2运行报错求助

问题解决:Electron 25.3.0打包程序在Windows Server 2008 R2运行报错找不到DiscardVirtualMemory

问题原因

Electron 25 基于 Chromium 114,而 Chromium 114 已正式终止对 Windows 7/Windows Server 2008 R2 的支持。DiscardVirtualMemory 是 Windows 8 及以上系统才提供的 KERNEL32.dll API,Windows Server 2008 R2 不包含该函数,因此运行时会抛出找不到入口点的错误。

解决方案

方案1:降级Electron到支持Windows Server 2008 R2的版本

Electron 22.x 是最后一批支持 Windows 7/Server 2008 R2 的版本,执行以下步骤:

  • 卸载当前Electron版本:npm uninstall electron
  • 安装指定版本:npm install electron@22 --save-dev
  • 重新使用electron-packager打包:electron-packager . migration-agenda-day --platform=win32 --arch=x64 --out=dist/ --overwrite

方案2:升级服务器操作系统

如果业务允许,将 Windows Server 2008 R2 升级到 Windows Server 2012 及以上版本,即可兼容Electron 25打包的程序。

内容的提问来源于stack exchange,提问作者William Ferruzola

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 10:13:12