安装sqlite3报错找不到c++/python/nodegyp错误,electron-vite,下载Visual Studio,配置vc环境变量

复制代码
npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm warn deprecated npmlog@6.0.2: This package is no longer supported.
npm warn deprecated are-we-there-yet@3.0.1: This package is no longer supported.
npm warn deprecated gauge@4.0.4: This package is no longer supported.
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '\\\\?\\E:\\mysctrip\\book-write\\front_electron_book\\node_modules\\node-gyp\\node_modules',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\node_modules'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'E:\\mysctrip\\book-write\\front_electron_book\\node_modules\\node-gyp\\node_modules'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path E:\mysctrip\book-write\front_electron_book\node_modules\sqlite3
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install -r napi || node-gyp rebuild
npm error prebuild-install warn install read ECONNRESET
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@8.4.1
npm error gyp info using node@22.21.1 | win32 | x64
npm error (node:11168) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info find Python using Python version 3.12.6 found at "D:\python\python.exe"
npm error gyp ERR! find VS
npm error gyp ERR! find VS msvs_version not set from command line or npm config
npm error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm error gyp ERR! find VS checking VS2022 (17.13.35931.197) found at:
npm error gyp ERR! find VS "D:\Visual Studio"
npm error gyp ERR! find VS - found "Visual Studio C++ core features"
npm error gyp ERR! find VS - found VC++ toolset: v143
npm error gyp ERR! find VS - missing any Windows SDK
npm error gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm error gyp ERR! find VS looking for Visual Studio 2015
npm error gyp ERR! find VS - not found
npm error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm error gyp ERR! find VS
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS You need to install the latest version of Visual Studio
npm error gyp ERR! find VS including the "Desktop development with C++" workload.
npm error gyp ERR! find VS For more information consult the documentation at:
npm error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm error gyp ERR! stack     at VisualStudioFinder.fail (E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm error gyp ERR! stack     at E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm error gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm error gyp ERR! stack     at E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm error gyp ERR! stack     at E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm error gyp ERR! stack     at E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\lib\util.js:54:7
npm error gyp ERR! stack     at E:\mysctrip\book-write\front_electron_book\node_modules\node-gyp\lib\util.js:33:16
npm error gyp ERR! stack     at ChildProcess.exithandler (node:child_process:424:5)
npm error gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm error gyp ERR! stack     at maybeClose (node:internal/child_process:1101:16)
npm error gyp ERR! System Windows_NT 10.0.26200
npm error gyp ERR! command "C:\\nvm4w\\nodejs\\node.exe" "E:\\mysctrip\\book-write\\front_electron_book\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm error gyp ERR! cwd E:\mysctrip\book-write\front_electron_book\node_modules\sqlite3
npm error gyp ERR! node -v v22.21.1
npm error gyp ERR! node-gyp -v v8.4.1
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: C:\Users\libai\AppData\Local\npm-cache\_logs\2025-12-26T11_30_31_176Z-debug-0.log

主要是

npm error gyp ERR! command "C:\\nvm4w\\nodejs\\node.exe" "E:\\mysctrip\\book-write\\front_electron_book\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"

npm error gyp ERR! find VS - found "Visual Studio C++ core features"

npm error gyp ERR! find VS - found VC++ toolset: v143 npm error gyp ERR! find VS - missing any Windows SDK npm error gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use

npm error gyp ERR! find VS including the "Desktop development with C++" workload.

关于Visual Studio 构建工具缺了或者没找到

先去这个网站https://visualstudio.microsoft.com/zh-hans/downloads/#build-tools-for-visual-studio-2022

下载下载器,看一下有没有安装,安装的全不全,少的就下载,不新的更新,c++桌面组和window-sdk是必选的,选好后下载,可以在安装位置题签中自定义安装位置,和是不是要缓存

当都下载完了,确定下载路径中有还是报错,配置一下环境变量

在刚刚Visual Studio下载的文件夹下找到

VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64

还不行可能是python没装或者node版本不够高,装python配个环境变量,升级一下node

相关推荐
blanks20209 小时前
生成 公钥私钥 笔记
node.js
怕浪猫2 天前
Electron 开发实战(十六):总结与展望|生态现状、框架对比、行业趋势与学习指南
前端·javascript·electron
糖拌西瓜皮2 天前
Java开发者视角:深入理解Node.js异步编程模型
java·后端·node.js
古德new2 天前
鸿蒙PC使用electron迁移:Joplin Electron 桌面适配全记录
华为·electron·harmonyos
智通2 天前
Node.js事件循环核心机制
node.js
三声三视3 天前
Electron 在鸿蒙 PC 上跑 webview,我是怎么把首屏从 4.2s 干到 1.1s 的
华为·electron·harmonyos·鸿蒙
初圣魔门首席弟子3 天前
Node.js 详细介绍(知识库版)
windows·qt·node.js·知识库
糖拌西瓜皮3 天前
Java 开发者如何快速上手 Node.js:一份从入门到进阶的学习路线
node.js
yspwf3 天前
NestJS 配置管理完整方案
后端·架构·node.js
网络点点滴3 天前
Node.js事件驱动架构
架构·node.js