{"record":{"id":"f52cbd1e527cc79d","repo":"denoland/deno","slug":"unsupported-platform-for-the-native-typescript-com","errorCode":null,"errorMessage":"Unsupported platform for the native TypeScript compiler: {arch} {os}","messagePattern":"Unsupported platform for the native TypeScript compiler: (.+?) (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"cli/tsc/native.rs","lineNumber":62,"sourceCode":"fn typescript_platform() -> Result<&'static str, AnyError> {\n  typescript_platform_for(std::env::consts::ARCH, std::env::consts::OS)\n}\n\n/// Map a Rust `(ARCH, OS)` pair (as in [`std::env::consts`]) to the\n/// `@typescript/typescript-<suffix>` package suffix. Split out so the mapping\n/// can be unit-tested for every supported host.\nfn typescript_platform_for(\n  arch: &str,\n  os: &str,\n) -> Result<&'static str, AnyError> {\n  Ok(match (arch, os) {\n    (\"x86_64\", \"linux\") => \"linux-x64\",\n    (\"aarch64\", \"linux\") => \"linux-arm64\",\n    (\"x86_64\", \"macos\") => \"darwin-x64\",\n    (\"aarch64\", \"macos\") => \"darwin-arm64\",\n    (\"x86_64\", \"windows\") => \"win32-x64\",\n    (\"aarch64\", \"windows\") => \"win32-arm64\",\n    _ => anyhow::bail!(\n      \"Unsupported platform for the native TypeScript compiler: {arch} {os}\"\n    ),\n  })\n}\n\n/// Ensure the pinned native `tsc` for the host platform is available and\n/// return the path to the executable, downloading the\n/// `@typescript/typescript-<platform>` npm package if it isn't cached yet.\n///\n/// This deliberately fetches only the single host-platform package rather than\n/// resolving `typescript` itself (whose optional dependencies would pull every\n/// platform binary), mirroring how [`crate::tools::bundle::esbuild`] obtains\n/// esbuild. Unlike esbuild (a single standalone binary), the tsc binary lives\n/// in a `lib/` directory next to the default `lib.*.d.ts` files it loads at\n/// runtime, so the whole `lib/` tree is materialized alongside it.\npub async fn ensure_native_tsc(\n  deno_dir: &DenoDir,\n  npmrc: &ResolvedNpmRc,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tsc/native.rs#L44-L80","documentation":"The native (Go) TypeScript compiler is only published for the six arch/OS pairs in the match table (x86_64/aarch64 × linux/macos/windows). Any other host fails platform resolution before a download is attempted, so `deno check` via the native path cannot run there.","triggerScenarios":"Running a deno build that routes through cli/tsc/native.rs on a host where `std::env::consts::(ARCH, OS)` is not in the table — e.g. armv7/i686 linux, freebsd, riscv64.","commonSituations":"32-bit or niche-architecture Linux/BSD machines; experimental platforms before @typescript/typescript-<platform> packages exist for them.","solutions":["Set DENO_TSC_BIN to an existing tsc binary you built or obtained — deno uses it directly and skips platform resolution and download","Run deno on a supported host (x86_64 or aarch64 on linux, macos, or windows)","When building deno from source for the platform, cross-compile or provide the compiler via DENO_TSC_BIN"],"exampleFix":"# before\ndeno check mod.ts   # on e.g. armv7 linux\n# after\nexport DENO_TSC_BIN=/usr/local/bin/tsc\ndeno check mod.ts","handlingStrategy":"fallback","validationCode":"# provision a compiler binary before running deno on an unsupported host\nexport DENO_TSC_BIN=/opt/tsc/tsc\n[ -x \"$DENO_TSC_BIN\" ] || { echo \"DENO_TSC_BIN not executable\" >&2; exit 1; }\ndeno check mod.ts","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set DENO_TSC_BIN on niche architectures (mirrors how CI avoids re-downloading)","Target the six supported arch/OS pairs when choosing build machines","Document host requirements when shipping deno-based tooling to exotic platforms"],"tags":["tsc","native","platform","unsupported-arch"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}