Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Node.js built-in TypeScript type stripping is now marked stable in Node.js v25.2.0 and v24.12.0. That status makes the feature a supported option for running TypeScript files that use erasable syntax—but it does not mean Node.js runs every TypeScript feature, checks types, or reads tsconfig.json.

What “stable” means for Node.js type stripping

The Node.js TypeScript documentation lists type stripping as stable in v25.2.0 and v24.12.0. The v24.12.0 LTS release record also lists “module: mark type stripping as stable” and credits Marco Ippolito.

Stable status is the latest step in a gradual rollout, not the date the capability first appeared. It was added in v22.6.0, enabled by default in v23.6.0 and v22.18.0, and stopped producing an experimental warning in v24.3.0 and v22.18.0. The current opt-out flag is --no-strip-types. In other words, “enabled by default” predates “stable.”

Can Node.js run TypeScript without changes?

Sometimes. Node.js can run TypeScript files when their TypeScript syntax can be erased without generating JavaScript code. It removes type syntax by replacing it with whitespace, preserving the remaining JavaScript structure. This is type stripping, not compilation into JavaScript with additional runtime behavior.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

It also does not type-check. A file can run despite type errors if the code reaches execution, so use a TypeScript checker separately when you need static validation. Whether a file can run unchanged depends on the syntax it uses and its imports.

Syntax that requires transformation

Some TypeScript constructs require code generation rather than simple removal. The Node.js documentation names enums and parameter properties as examples. Those are outside ordinary type stripping; the separately documented --experimental-transform-types option is relevant when using such syntax.

Type-only imports must be explicit

Mark imports used only for types with the type keyword, such as import type { User } from './user.ts';. Without that marker, Node.js treats an import as a value import. If the imported type has no runtime export, execution can fail with a runtime error.

Important limits of the built-in support

  • No type checking: Stripping removes type syntax; it does not validate types.
  • No tsconfig.json support: Node.js ignores this file, so its compiler options do not configure the runtime.
  • Not every TypeScript construct is handled: Syntax requiring JavaScript generation falls outside ordinary stripping.
  • No TypeScript files under node_modules: Node.js refuses to handle TypeScript files in those folders, a documented design constraint.

How to run TypeScript with Node.js

For a script that stays within erasable syntax, run the TypeScript file directly with Node.js:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
node my-script.ts

This path suits lightweight scripts and projects that can use JavaScript-compatible TypeScript syntax. It does not run a type checker or apply settings from tsconfig.json.

Configure TypeScript alongside Node.js

The Node.js guide recommends TypeScript 5.8 or newer and gives these settings as guidance for configuring TypeScript alongside the runtime:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "nodenext",
    "rewriteRelativeImportExtensions": true,
    "erasableSyntaxOnly": true,
    "verbatimModuleSyntax": true
  }
}

noEmit is optional when the intent is only to execute TypeScript files, such as a build script. These settings help TypeScript align with Node.js’s runtime behavior; Node.js itself does not read the configuration file.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose built-in stripping or a TypeScript runtime tool

Need Node.js built-in stripping Third-party runtime tooling
Syntax coverage Erasable TypeScript syntax; some constructs requiring transformation are not covered by ordinary stripping. The Node.js guide recommends third-party tooling for projects that need all TypeScript features.
Runtime type checking Not provided. Not established by the Node.js guide as a general property of runtime tools; use a checker when type validation is required.
tsconfig.json support Not read by Node.js. Recommended route when the project needs tsconfig support; capabilities depend on the chosen tool.
Best fit Lightweight execution when the project can keep to erasable syntax. Projects needing broader TypeScript support; tsx is one example cited by Node.js.

Use built-in stripping when the simpler runtime path fits the syntax and workflow you want. Choose a third-party tool such as tsx when you need broader TypeScript feature support or configuration behavior that Node.js does not provide. Keep type checking as a separate step if your project depends on it; neither direct execution nor stripping, by itself, establishes that the code is type-safe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.