首页 > 解决方案 > 将 electron-wix-msi 从 2.2.0 升级到 3.0.0 时出错

问题描述

我正在为我的电子应用程序创建 MSI 安装程序,并且我想在安装应用程序时添加一个桌面快捷方式图标。早些时候我使用的是不提供该功能的 electron-wix-msi@2.2.0。3.0.0版本增加桌面快捷图标功能。将 electron-wix-msi 从版本 2.2.0 升级到 3.0.0 时出现错误

npm install electron-wix-msi@3.0.0

> exe-icon-extractor@1.0.8 install F:\002_Installer_Upgrade\node_modules\exe-icon-extractor
> node-gyp rebuild


F:\002_Installer_Upgrade\node_modules\exe-icon-extractor>if not defined npm_config_node_gyp (node "C:\Users\xxxxxxxx\AppData\Roaming\nvm\v10.16.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\xxxxxxxxx\AppData\Roaming\nvm\v10.16.3\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  module.cc
  win_delay_load_hook.cc
..\src\module.cc(275): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [F:\002_Installer_Upgrade\node_modules\exe-icon-extractor\build\module.vcxproj]
..\src\module.cc(330): warning C4101: 'status' : unreferenced local variable [F:\002_Installer_Upgrade\node_modules\exe-icon-extractor\build\module.vcxproj]
LINK : fatal error LNK1117: syntax error in option 'LTCG:INCREMENTAL' [F:\002_Installer_Upgrade\node_modules\exe-icon-extractor\build\module.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\xxxxxxxxx\AppData\Roaming\nvm\v10.16.3\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxxxxxxxx\\AppData\\Roaming\\nvm\\v10.16.3\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\002_Installer_Upgrade\node_modules\exe-icon-extractor
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN saveError ENOENT: no such file or directory, open 'F:\002_Installer_Upgrade\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'F:\002_Installer_Upgrade\package.json'
npm WARN 002_Installer_Upgrade No description
npm WARN 002_Installer_Upgrade No repository field.
npm WARN 002_Installer_Upgrade No README data
npm WARN 002_Installer_Upgrade No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: exe-icon-extractor@1.0.8 (node_modules\exe-icon-extractor):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: exe-icon-extractor@1.0.8 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ electron-wix-msi@3.0.0
updated 1 package and audited 77 packages in 18.198s
found 4 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

我正在使用 node-gyp@3.8.0。是node-gyp的问题吗?

标签: javascriptnpmelectron

解决方案


推荐阅读