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

相关推荐
笨鸟先飞,勤能补拙3 小时前
AI 赋能网络安全:技术全景、成熟度评估与实战案例
人工智能·python·安全·web安全·网络安全·sqlite·github
陳陈陳10 小时前
🚀 前端流式输出革命:SSE + BFF 架构从零到一实战指南
vue.js·架构·node.js
Revolution6110 小时前
第一次运行 Node.js:终端里的 JavaScript 怎样执行
后端·面试·node.js
半句唐诗11 小时前
我是如何通过 Access Token 成功发布第一个 npm 包的
前端·npm·node.js
贩卖黄昏的熊12 小时前
NestJS简明教程——异常处理和日志
javascript·node.js·nest.js
upgrador16 小时前
桌面应用开发:Electron 与 NSIS 的关系、打包流程及 Windows 本地构建实战
javascript·windows·electron
Revolution6116 小时前
Node.js 是什么:前端项目里哪些事情由它完成
前端·面试·node.js
Revolution6116 小时前
Nest.js 是什么:怎样用它写出第一个后端接口
后端·node.js·nestjs
韭菜炒鸡肝天18 小时前
Django模型迁移指南:从命令用法到最佳实践
数据库·django·sqlite
柳林林19 小时前
解决 nvm 切换 Node.js 版本时报“没有文件扩展 ‘.vbs’ 的脚本引擎”错误
node.js