解决node-gyp构建错误Windows x64

本文介绍了在使用electron构建APP时遇到的node-gyp构建错误,并提供了解决方案。错误涉及到Python版本和.NET Framework 2.0 SDK的安装。通过调整Python环境、下载.NET Framework或重新配置node-sass包,可以成功解决构建问题。同时,文章提到了微软开发的可视化对象标注工具VoTT,该工具具有良好的用户体验和React代码结构,但存在依赖Azure托管、缺少内置API等不足。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决node-gyp构建错误Windows x64

最近在接触 electron 构建 APP

在构建过程中遇到一些坑,在此记录一下
先share一下我的报错
在这里插入图片描述
中间的曲折不多说了,直接上结果好啦
首先 和 node-gyp 更搭配的 Python 版本是 2.7.* bz用的是 2.7.12

  1. 要去 Python 官网 下载自己电脑对应的安装包 并将其添加到系统路径(C:\ Python27)
  2. 下载安装 .NET Framework 2.0 SDK 或者 安装 VS
  3. 重点
// 管理员权限运行 cmd 
 npm install -g node-gyp
 npm install --global --production windows
D:\00JVAV\Workspaces\springboot\library-manager\inc-view\node_modules\canvas>if not defined npm_config_node_gyp (node "D:\nvm\v12.17.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer 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 ************************************************************** 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 (D:\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) gyp ERR! stack at D:\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (D:\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14) gyp ERR! stack at D:\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14 gyp ERR! stack at D:\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16 gyp ERR! stack at D:\nvm\v12.17.0\node_modules\npm\node_modules\node-gyp\lib
03-27
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值