Native TypeScript support in Node.js fits small scripts and project utilities that already use JavaScript-compatible runtime syntax. The runtime removes erasable type annotations while loading the file, so a simple .ts file can run with node without a separate transpile step.
The built-in loader does not run the TypeScript compiler. It ignores tsconfig.json for path aliases and downlevel transforms, keeps normal Node.js module rules, and requires file extensions such as ./helper.ts in import specifiers.
Use native execution when the file stays inside the type-stripping subset. Keep a separate type-checking or build step for projects that use enums, decorators, parameter properties, TSX, path aliases, or other TypeScript features that need generated JavaScript.
$ node --version v24.18.0
Use Node.js 24.12 LTS or newer for stable type stripping. Earlier supported releases had experimental behavior or warnings.
type User = {
name: string;
active: boolean;
};
function describe(user: User): string {
return `${user.name} is ${user.active ? "active" : "inactive"}`;
}
const account: User = { name: "Mira", active: true };
console.log(describe(account));
Type aliases, interfaces, and typed parameters are removed before execution. Node.js still runs the remaining JavaScript without type-checking it.
$ node greeter.ts Mira is active
For multi-file code, include the .ts, .mts, or .cts extension in import specifiers. Node.js does not resolve ./helper to ./helper.ts.
enum Status {
Ready = "ready",
}
console.log(Status.Ready);
Native type stripping rejects enums, parameter properties, runtime namespaces, import aliases, decorators, and TSX. Use tsc, tsx, or another transpiling runner when the project needs those features.
$ node unsupported.ts
/home/developer/native-ts-demo/unsupported.ts:1
> enum Status {
Ready = "ready",
> }
SyntaxError [ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX]: TypeScript enum is not supported in strip-only mode
##### snipped #####
$ rm greeter.ts unsupported.ts