{"record":{"id":"dce964e03c72d57a","repo":"earendil-works/pi","slug":"microsoft-c-build-tools-not-found-install-the-v","errorCode":null,"errorMessage":"Microsoft C++ Build Tools not found. Install the Visual Studio C++ workload or set PI_TUI_WIN32_TOOLCHAIN=mingw.","messagePattern":"Microsoft C\\+\\+ Build Tools not found\\. Install the Visual Studio C\\+\\+ workload or set PI_TUI_WIN32_TOOLCHAIN=mingw\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/tui/native/win32/build.mjs","lineNumber":224,"sourceCode":"  PI_TUI_WIN32_TOOLCHAIN=msvc|mingw\n  CC_X64=/path/to/x86_64-w64-mingw32-gcc\n  CC_ARM64=/path/to/aarch64-w64-mingw32-gcc\n  CC=/path/to/clang`);\n\tprocess.exit(0);\n}\n\nconst requestedToolchain = process.env.PI_TUI_WIN32_TOOLCHAIN;\nif (requestedToolchain && requestedToolchain !== \"msvc\" && requestedToolchain !== \"mingw\") {\n\tthrow new Error(\"PI_TUI_WIN32_TOOLCHAIN must be either 'msvc' or 'mingw'\");\n}\n\nconst vsDevCmd = findVisualStudioDevCmd();\nconst hasMsvc = vsDevCmd ? canUseMsvc(vsDevCmd) : false;\nconst toolchain = requestedToolchain ?? (process.platform === \"win32\" && vsDevCmd ? \"msvc\" : \"mingw\");\n\nif (toolchain === \"msvc\") {\n\tif (!vsDevCmd || !hasMsvc) {\n\t\tthrow new Error(\"Microsoft C++ Build Tools not found. Install the Visual Studio C++ workload or set PI_TUI_WIN32_TOOLCHAIN=mingw.\");\n\t}\n\tfor (const target of targets) buildWithMsvc(target, vsDevCmd);\n} else {\n\tfor (const target of targets) buildWithMingw(target);\n}\n","sourceCodeStart":206,"sourceCodeEnd":230,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/tui/native/win32/build.mjs#L206-L230","documentation":"Error \"Microsoft C++ Build Tools not found. Install the Visual Studio C++ workload or set PI_TUI_WIN32_TOOLCHAIN=mingw.\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/tui/native/win32/build.mjs:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the Visual Studio C++ workload, or set PI_TUI_WIN32_TOOLCHAIN=mingw."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}