Windows 11 安装AIRI踩坑指北
最近在Windows笔记本上想要折腾一下AIRI,参考了 你的电子老婆开源了!登顶GitHub热榜这篇文章
但没想到坑这么多╰(‵□′)╯,,,这里记录一下,为后人参考
一、nodejs安装问题
在使用scoop安装nodejs之后,遇到了如下问题:
> corepack enable corepack : 无法将“corepack”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保 路径正确,然后再试一次。 所在位置 行:1 字符: 1 + corepack enable + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (corepack:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException原因是使用如下命令进行安装,会自动安装nodejs的25版本,这个版本不自带corepack,修复方法如下
# 有问题的命令 scoop install nodejs # 修复如下,即安装稳定版 scoop install nodejs-lts二、c++组件问题
后续顺利安装了nodejs和pnpm等,但使用 pnpm install 时,遇到了如下问题:
apps/stage-tamagotchi postinstall$ electron-builder install-app-deps │ • electron-builder version=26.8.1 │ • loaded configuration file=package.json ("build" field) │ [electron-builder/config] Warning: Xcode version is below 26. Using .icns format for macOS app icon. │ • loaded parent configuration file=D:\BaiduNetdiskDownload\AIRI\airi\apps\stage-tamagotchi\electron-builder.conf… │ • packageManager not detected by file, falling back to environment detection resolvedPackageManager=pnpm detecte… │ • detected workspace root for project using packageManager field pm=pnpm config=pnpm@10.30.3 resolved=D:\BaiduNe… │ • executing @electron/rebuild electronVersion=40.6.1 arch=x64 buildFromSource=false workspaceRoot=D:\BaiduNetdis… │ • installing native dependencies arch=x64 │ • preparing moduleName=@parcel/watcher arch=x64 │ ⨯ (node:24752) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that … │ (Use `node --trace-deprecation ...` to show where the warning was created) │ (node:24752) [DEP0190] DeprecationWarning:也就是在安装stage-tamagotichi的时候,找不到编译 C++ 代码所需的 Visual Studio 生成工具 (Build Tools)
检查发现是我之前使用 visual studio installer 安装的为2026版本的 visual studio,无法被正确调用;
解决方法也很简单,安装 visual studio 2022 即可,可以使用下面链接的文件进行安装,能够节省一些空间:https://aka.ms/vs/17/release/vs_buildtools.exe
注意:
- 在 visual studio 2026 中以单个组件的方式安装对应的C++组件也是不行的,没法被检测到
- 使用环境变量、.npmrc 文件中指定编译器版本或路径也不可以,调用的底层安装函数不认这个设置
