安装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

相关推荐
神仙别闹5 分钟前
基于C语言+SQLite 实现(控制台+图形界面)图书管理系统
c语言·开发语言·sqlite
frjc31 分钟前
Node.js 与 npm 极简安装教程
前端·npm·node.js
迷迭香yy39 分钟前
A股数据本地存储方案对比JSON、SQLite、ClickHouse、DuckDB怎么选 IG50免费开源股票数据API接口
clickhouse·sqlite·json
深念Y44 分钟前
QQ 数据库解密与聊天记录导出 — 技术文档
数据库·sqlite·手机·数据恢复·逆向·二进制·qq
水獭比特16 小时前
工作流都公开了,为什么还不能继承 Owner 权限?
javascript·人工智能·node.js
冲冲19 小时前
nvm-windows的安装
node.js
楠楠子呀1 天前
号码验证技术解析:从原理到实践
运维·人工智能·ai·electron·自动化
秋秋小事1 天前
LangChain的核心概念与生态
node.js
蜕变的土豆1 天前
SQLite文件加密完整教程:从零学会SQLCipher全库加密(C++实战)
c++·sqlite
坚定信念,勇往无前1 天前
electron打包mac ,apple m4出错:ffprobe是x86,不是arm64
前端·javascript·electron