TypeScript Compiler Options
--version — TypeScript CLI
Reports the compiler version selected by the command invocation, not the Node.js version or every installed TypeScript package. In a real project use the intended local executable or package script to avoid accidentally inspecting a global installation. Baseline: TypeScript 5.8.3. Commands are run with the pinned local compiler in an isolated directory; omit file labels. CLI-only setting.
Formal Syntax & Structure
typescript syntaxtypescript
tsc --version | tsc -vParameters & Attributes
| Name | Type | Description |
|---|---|---|
| version | boolean | Optional command switch; omit to leave the command inactive. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES2022", "module": "CommonJS", "strict": true, "types": [], "outDir": "dist" }, "files": [ "index.ts" ]}// File: index.ts (omit this label)export const count: number = 7;
// Run in a temporary project:// tsc --version