Node 24 Runs TypeScript Natively by Stripping Types, Not Compiling Them

Node.js 24 can execute TypeScript files directly without a build step, using a bundled tool called Amaro that strips type annotations in place rather than compiling them. The feature, which became flag-free as of Node 23.6, works by replacing type annotations with blank spaces of equal length, preserving column positions and making error stack traces accurate without source maps. Because the mechanism is purely additive stripping, Node does not read tsconfig.json, perform type checking, or support TypeScript features that require code generation such as decorators. Developers can check which mode is active at runtime via process.features.typescript, and can disable stripping entirely using the --no-strip-types flag to verify compiled output is being used instead. The approach suits small services and scripts well but has documented limitations that can cause unexpected runtime errors if TypeScript-only features are relied upon.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in