{"record":{"id":"8b58acf4edf62ad5","repo":"nodejs/node","slug":"s-is-missing-make-sure-vc-tools-are-installed","errorCode":null,"errorMessage":"%s is missing - make sure VC++ tools are installed.","messagePattern":"(.+?) is missing - make sure VC\\+\\+ tools are installed\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/MSVSVersion.py","lineNumber":156,"sourceCode":"                return [vcvarsall, \"amd64_x86\"]\n            else:\n                # Otherwise, the standard x86 compiler. We don't use VC/vcvarsall.bat\n                # for x86 because vcvarsall calls vcvars32, which it can only find if\n                # VS??COMNTOOLS is set, which isn't guaranteed.\n                return [JoinPath(self.path, \"Common7\", \"Tools\", \"vsvars32.bat\")]\n        elif target_arch == \"x64\":\n            arg = \"x86_amd64\"\n            # Use the 64-on-64 compiler if we're not using an express edition and\n            # we're running on a 64bit OS.\n            if self.short_name[-1] != \"e\" and is_host_arch_x64:\n                arg = \"amd64\"\n            return [vcvarsall, arg]\n\n    def SetupScript(self, target_arch):\n        script_data = self._SetupScriptInternal(target_arch)\n        script_path = script_data[0]\n        if not os.path.exists(script_path):\n            raise Exception(\n                \"%s is missing - make sure VC++ tools are installed.\" % script_path\n            )\n        return script_data\n\n\ndef _RegistryQueryBase(sysdir, key, value):\n    \"\"\"Use reg.exe to read a particular key.\n\n    While ideally we might use the win32 module, we would like gyp to be\n    python neutral, so for instance cygwin python lacks this module.\n\n    Arguments:\n      sysdir: The system subdirectory to attempt to launch reg.exe from.\n      key: The registry key to read from.\n      value: The particular value to read.\n    Return:\n      stdout from reg.exe, or None for failure.\n    \"\"\"","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/MSVSVersion.py#L138-L174","documentation":"MSVSVersion.SetupScript raises Exception('%s is missing - make sure VC++ tools are installed.') when the resolved vcvarsall/Setup script path returned by _SetupScriptInternal(target_arch) does not exist on disk. gyp needs the Visual Studio environment batch file (e.g. vcvarsall.bat or vsvars32.bat) to set up the compiler for the requested target architecture; if the file isn't there, the toolchain isn't really installed at the recorded VS path.","triggerScenarios":"Selecting a Visual Studio version whose registry/detected path points to a shell install (e.g. only the IDE, no C++ workload); target_arch 'x64' or 'x86' resolving to vcvarsall.bat under a path where only the Express SKU or BuildTools partial install exists; corrupted VS install.","commonSituations":"Fresh Windows machine with VS installed but the 'Desktop development with C++' workload unchecked; using VS Code without the full VS Build Tools; PATH/registry pointing at a leftover VS folder after uninstall.","solutions":["Install the 'Desktop development with C++' workload (or the standalone Build Tools for VS) including MSVC and the Windows SDK.","Run the VS Installer and Repair the detected installation.","Verify the script path printed in the error actually exists; if the registered VS path is stale, re-detect or set GYP_MSVS_VERSION/GYP_MSVS_OVERRIDE_PATH to a real install.","If using Express, ensure target_arch matches what Express supports (x86 only on older Express)."],"exampleFix":"# before: VS installed without C++ workload\n# -> '%s is missing - make sure VC++ tools are installed.'\n\n# after: install the workload via VS Installer CLI\n# vs_installer.exe modify --installPath <VSPath> --add Microsoft.VisualStudio.Workload.NativeDesktop --quiet","handlingStrategy":"validation","validationCode":"import os\nvs_version = _GetVisualStudioVersion('auto')\nscript_path = vs_version.SetupScript(target_arch)[0]\nif not os.path.exists(script_path):\n    raise SystemExit('VC++ setup script missing: %s. Install the C++ workload.' % script_path)","typeGuard":"def setup_script_exists(vs_version, target_arch: str) -> bool:\n    import os\n    try:\n        return os.path.exists(vs_version.SetupScript(target_arch)[0])\n    except Exception:\n        return False","tryCatchPattern":"try:\n    script = vs_version.SetupScript(target_arch)\nexcept Exception as e:\n    # prompt to install/repair VS C++ workload\n    raise SystemExit('%s\\nInstall \"Desktop development with C++\" in the VS Installer.' % e)","preventionTips":["Install VS with the 'Desktop development with C++' workload (or the standalone Build Tools).","Run VS Installer Repair when the toolchain path goes missing.","In CI, pre-validate that vcvarsall.bat exists before invoking gyp."],"tags":["gyp","msvs","visual-studio","windows","toolchain","environment"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}