microsoft/typescript-go · critical · Error
Executable not found: ${exe}
Error message
Executable not found: ${exe} What it means
Thrown by getExePath() as the final check: the platform package resolved successfully, but the expected executable (<exeDir>/lib/tsgo or tsc, plus .exe on Windows) does not exist on disk. Resolution succeeded while the payload is missing, which points to content-level corruption rather than a dependency-graph problem.
Source
Thrown at _packages/native-preview/lib/getExePath.js:66
const packageJsonPath = fileURLToPath(packageJson);
exeDir = path.join(path.dirname(packageJsonPath), "lib");
}
}
catch (e) {
throw new Error("Unable to resolve " + platformPackageName + ". Either your platform is unsupported, or you are missing the package on disk.");
}
}
let exe = path.join(exeDir, binName);
if (process.platform === "win32") {
exe += ".exe";
if (exe.length >= 248) {
exe = "\\\\?\\" + exe;
}
}
if (!fs.existsSync(exe)) {
throw new Error("Executable not found: " + exe);
}
return exe;
}
View on GitHub (pinned to 1bcfa18d79)
Solutions
- Reinstall the platform package (remove node_modules/@typescript/native-preview-* and npm/yarn/pnpm install) to restore the binary
- Check antivirus quarantine logs for tsgo/tsgo.exe and add an allowlist/exclusion for your project directory
- Verify the file directly: ls node_modules/@typescript/native-preview-<platform>-<arch>/lib/tsgo(.exe)
- If running inside the TypeScript repo, build artifacts first with hereby build
- Bust stale CI caches for node_modules and reinstall
Example fix
# before # lib dir exists but binary was quarantined/never extracted ls node_modules/@typescript/native-preview-linux-x64/lib/ # -> package.json # after rm -rf node_modules/@typescript/native-preview-linux-x64 && npm install ls node_modules/@typescript/native-preview-linux-x64/lib/ # -> package.json tsgo
Defensive patterns
Strategy: validation
Validate before calling
// Pre-flight the exact binary path getExePath() will return
import fs from 'node:fs';
import path from 'node:path';
const exeDir = path.dirname(require.resolve('@typescript/native-preview/package.json'));
const exe = path.join(exeDir, '..', `native-preview-${process.platform}-${process.arch}`, 'lib', 'tsgo' + (process.platform === 'win32' ? '.exe' : ''));
if (!fs.existsSync(exe)) throw new Error(`tsgo binary missing at ${exe} - reinstall the platform package`); Try / catch
try {
exe = getExePath();
} catch (e) {
if (e instanceof Error && e.message.includes('Executable not found')) {
// dependency resolved but payload missing: reinstall + check AV quarantine
console.error(e.message, '- reinstall the platform package and check antivirus');
} else throw e;
} Prevention
- Exclude the project directory from real-time antivirus scanning
- Verify lib/tsgo presence in postinstall smoke tests
- Do not prune 'unused' files from node_modules platform packages in Docker slims
When it happens
Trigger: Antivirus quarantined or deleted the unsigned tsgo.exe; production installs/pruning that strip binaries out of lib; partially extracted node_modules or truncated downloads; running from a repo-shaped checkout where the matched built/npm layout lacks the freshly built artifacts.
Common situations: Windows Defender/endpoint tools removing the Go binary; npm cache corruption delivering an empty lib directory; 'slim' Docker stages copying package.json without lib; CI caches that cached node_modules before postinstall artifacts landed.
Related errors
- Could not find a TypeScript executable in the extension pack
- Unable to resolve ${platformPackageName}. Either your platfo
- _submodules/TypeScript does not exist; try running `git subm
- Expected version in .custom-gcl.yml
- Source file does not exist: ${src}
AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16).
Data as JSON: /api/errors/0aacb7f3aa2e6cfa.
Report an issue: GitHub.