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

相关推荐
程序员王天2 小时前
SQLite 查询优化实战:从9秒到300毫秒
数据库·electron·sqlite
朱穆朗2 小时前
electron升级到33.0.x版本后,devtools字体的修改方法
前端·javascript·electron
小高00716 小时前
Elips-Core:轻量级 Node.js Web 框架核心实现
前端·javascript·node.js
前端流一16 小时前
Node.js 原生实现JSON-RPC及长进程双向通信实践
node.js
undsky20 小时前
【RuoYi-Eggjs】:多数据库与 MyBatis 特性详解
node.js·mybatis·egg.js
王夏奇1 天前
财务报销人民币大写数值书写规范与规则
sqlite
梵尔纳多1 天前
打包 Electron 程序
前端·javascript·electron
梵尔纳多1 天前
使用 Electron 实现一个简单的文本编辑器
前端·javascript·electron
weixin_462446231 天前
使用 cnchar 生成汉字拼音、笔画、组词数据(Node.js 实战教程)
node.js