首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法使用电子构建器构建应用程序。错误: gyp失败,退出代码:1

无法使用电子构建器构建应用程序。错误: gyp失败,退出代码:1
EN

Stack Overflow用户
提问于 2022-11-11 07:01:26
回答 2查看 148关注 0票数 0

我正在开发电子应用程序,为了构建可执行文件,我正在使用电子生成器

我有以下环境:

  • 电子生成器版本:^23.6.0,
  • 节点版本: v14.21.1
  • 电子版本:^10.1.5
  • 电子类型(电流,β,夜间):电流
  • 目标:窗口

我已经安装了Python3.11,not-gypv8.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 2022和MS 2022。还将python添加到环境变量和VS到npm配置中。

我得到了以下错误:

代码语言:javascript
运行
复制
> zinniax-chathub@2.7.0 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  dependencies=bufferutil@4.0.7, utf-8-validate@5.0.10 platform=win32 arch=x64
  • packaging       platform=win32 arch=x64 electron=10.4.7 appOutDir=zinniax-chathub-setup\win-unpacked
  • rebuilding native dependencies  dependencies=bufferutil@4.0.7, utf-8-validate@5.0.10 platform=win32 arch=ia32
  ⨯ cannot execute  cause=exit status 1
                    out=
> bufferutil@4.0.7 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! bufferutil@4.0.7 install: `node-gyp-build`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the bufferutil@4.0.7 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 bufferutil@4.0.7 utf-8-validate@5.0.10
                    workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zinniax-chathub@2.7.0 build-installer: `electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zinniax-chathub@2.7.0 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

我尝试了各种解决方案:

  • 删除节点-模块和重新安装
  • 重新安装节点-gpy全局
  • npm更新和npm安装
  • 安装的Visual生成工具
  • 使用Python2.7、3.x和win store Python版本进行了尝试
  • VS Build tools 2022,VS Community 2022

但没什么对我有用的。此问题发生在我格式化我的笔记本电脑之后。早些时候,它运转良好。

EN

Stack Overflow用户

回答已采纳

发布于 2022-11-11 14:14:12

更新电子到v21.2.3(最新)工作!

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74399030

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档