gpt4 book ai didi

node.js - 无法使用 Electron 构建器构建应用程序。错误: gyp failed with exit code: 1

转载 作者:行者123 更新时间:2023-12-03 08:00:36 25 4
gpt4 key购买 nike

我正在开发 Electron 应用程序并构建可执行文件,我正在使用 electron-builder

我有以下环境:

  • Electron-Builder 版本:^23.6.0,
  • Node 版本:v14.21.1
  • Electron 版本:^10.1.5
  • Electron 类型(当前、测试版、夜间):当前
  • 目标:Windows

我已经安装了 Python 3.11、node-gyp v8.4.0(最新 9.3 给出 gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp 错误,因此回滚了该版本)、Microsoft Visual Studio 2022 和 MS VS Build 工具 2022。还将 python 添加到环境变量,并将 VS 添加到 npm 配置。

我收到以下错误:

> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f08a999e9e999188dd93989184988592b0c2dec7dec0" rel="noreferrer noopener nofollow">[email protected]</a> build-installer D:\CodeMaster\ZinniaX-Chat-Frontend
> electron-builder

• electron-builder version=23.6.0 os=10.0.22621
• loaded configuration file=package.json ("build" field)
• writing effective config file=zinniax-chathub-setup\builder-effective-config.yaml
• rebuilding native dependencies <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f0b0a1f0a010b0a010c060a1c520d1a09090a1d1a1b06032f5b415f4158" rel="noreferrer noopener nofollow">[email protected]</a>, <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a0d5d4c68d988dd6c1ccc9c4c1d4c5e0958e908e9190" rel="noreferrer noopener nofollow">[email protected]</a> platform=win32 arch=x64
• packaging platform=win32 arch=x64 electron=10.4.7 appOutDir=zinniax-chathub-setup\win-unpacked
• rebuilding native dependencies <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="83e7e6f3e6ede7e6ede0eae6f0bee1f6e5e5e6f1f6f7eaefc3b7adb3adb4" rel="noreferrer noopener nofollow">[email protected]</a>, <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6d18190b4055401b0c0104090c19082d58435d435c5d" rel="noreferrer noopener nofollow">[email protected]</a> platform=win32 arch=ia32
⨯ cannot execute cause=exit status 1
out=
> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6b4a3b0b0b3a4a3a2bfba96e2f8e6f8e1" rel="noreferrer noopener nofollow">[email protected]</a> install D:\CodeMaster\ZinniaX-Chat-Frontend\node_modules\bufferutil
> node-gyp-build


errorOut=gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2017
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2022 (17.4.33103.184) found at:
gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v143
gyp ERR! find VS - missing any Windows SDK
gyp ERR! find VS checking VS2022 (17.4.33103.184) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v143
gyp ERR! find VS - missing any Windows SDK
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
gyp ERR! stack at C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\node-gyp\lib\find-visualstudio.js:75:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
gyp ERR! stack at C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\node-gyp\lib\find-visualstudio.js:71:14
gyp ERR! stack at C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\node-gyp\lib\find-visualstudio.js:384:16
gyp ERR! stack at C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:390:5)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at maybeClose (internal/child_process.js:1088:16)
gyp ERR! System Windows_NT 10.0.22621
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\faiza\\AppData\\Roaming\\nvm\\v14.21.1\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\CodeMaster\ZinniaX-Chat-Frontend\node_modules\bufferutil
gyp ERR! node -v v14.21.1
gyp ERR! node-gyp -v v8.4.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2d0c7d4d4d7c0c7c6dbdef2869c829c85" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f89a8d9e9e9d8a8d8c9194b8ccd6c8d6cf" rel="noreferrer noopener nofollow">[email protected]</a> install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\faiza\AppData\Roaming\npm-cache\_logs\2022-11-11T06_57_00_232Z-debug.log

command='C:\Program Files\nodejs\node.exe' 'C:\Users\faiza\AppData\Roaming\nvm\v14.21.1\node_modules\npm\bin\npm-cli.js' rebuild <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a0c2d5c6c6c5d2d5d4c9cce0948e908e97" rel="noreferrer noopener nofollow">[email protected]</a> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="374243511a0f1a41565b5e5356435277021907190607" rel="noreferrer noopener nofollow">[email protected]</a>
workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="205a494e4e4941580d4348415448554260120e170e10" rel="noreferrer noopener nofollow">[email protected]</a> build-installer: `electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f48e9d9a9a9d958cd9979c95809c8196b4c6dac3dac4" rel="noreferrer noopener nofollow">[email protected]</a> build-installer script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\faiza\AppData\Roaming\npm-cache\_logs\2022-11-11T06_57_00_312Z-debug.log

我尝试了各种解决方案:

  • 删除 Node 模块并重新安装
  • 全局重新安装node-gpy
  • npm 更新和 npm 安装
  • 已安装 Visual Studio 构建工具
  • 尝试过 Python 2.7、3.x 和 win store python 版本
  • VS 构建工具 2022、VS 社区 2022

但对我来说没有任何作用。我格式化笔记本电脑后出现此问题。早些时候它运行良好

最佳答案

将 Electron 更新到 v21.2.3(最新)有效!

关于node.js - 无法使用 Electron 构建器构建应用程序。错误: gyp failed with exit code: 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74399030/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com