Free tools Windows power users keep installed
One-click scans. No signup required.
Recent Node.js releases can run many .ts files directly, without a separate runtime transpiler. The built-in feature strips erasable TypeScript syntax; it does not check types, apply your tsconfig.json, or transform every TypeScript feature. It is stable in Node.js v24.12.0 and v25.2.0 and later in those release lines. Whether it fits your project depends on the syntax you use and how your modules and imports are written.
Run a TypeScript file directly
With a recent Node.js version, invoke the file as you would a JavaScript entry point:
As an Amazon Associate I earn from qualifying purchases.
node app.ts
Node.js says, “By default Node.js will execute TypeScript files that contains only erasable TypeScript syntax.” The feature was introduced in v22.6.0, enabled by default in v22.18.0 and v23.6.0, and became stable in v24.12.0 and v25.2.0. Check the current Node.js TypeScript documentation for version-specific details; older releases do not necessarily have the same default behavior. Node.js announced the default in v23.6.0 while the feature was still experimental in that release line (release announcement).
Node removes type annotations by replacing them with whitespace, preserving source positions without generating source maps. The result is executable JavaScript, not a compiled TypeScript build. You can also use supported TypeScript syntax with --eval or standard input when the relevant --input-type is set. TypeScript syntax is not supported in the REPL, --check, or inspect, and Node.js will not process TypeScript files inside node_modules.
#1 Best Overall
What Node.js strips—and what it does not
The dividing line is whether TypeScript syntax can be erased while leaving valid JavaScript. Type annotations and type-only constructs that disappear at runtime fit this model. TypeScript 5.8 describes the boundary with its erasableSyntaxOnly compiler option (TypeScript 5.8 Release Notes).
Syntax that needs a transform
Node’s stripping-only mode does not generate runtime code for TypeScript features. The Node.js documentation calls out enums, namespaces with runtime code, parameter properties, and import aliases; TypeScript-specific import = and export = forms are also non-erasable examples. Decorators are not transformed and produce parser errors under the documented behavior. For these features, use a tool that performs the required transformation rather than expecting native stripping to compile them.
Rank #2
Type stripping is not type checking
Node.js removes type syntax but does not verify that values satisfy their declared types. If static validation is part of your workflow, run the TypeScript compiler separately, for example with npx tsc --noEmit when your project is configured for a no-output check. TypeScript describes its role as a static typechecker that runs before code executes (The TypeScript Handbook). The runtime shortcut and the checker solve different problems.
Imports and module rules still apply
Node.js supports CommonJS and ES module syntax in TypeScript files, but it does not convert one module system into the other. Module interpretation follows the corresponding JavaScript rules, so the file extension, package configuration, and import style must agree with the module system you intend to use.
Rank #3
Use runtime-resolvable extensions
For relative imports, write paths Node.js can resolve at runtime. A TypeScript source import can include its extension, for example:
import type { User } from './types.ts';
import { loadUser } from './load-user.ts';
The type modifier makes clear that User is needed only for checking. Without it, Node treats an import as a runtime value import, which may fail if the module does not provide that value. The verbatimModuleSyntax TypeScript option aligns the checker’s import handling with this behavior.
Rank #4
Do not expect tsconfig path aliases or downleveling
Node.js does not read tsconfig.json. It will not rewrite aliases configured with paths, and it will not transform newer JavaScript syntax to match an older target. Subpath imports are a documented runtime option for some aliasing needs, but their specifiers must start with #.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11For authoring and checking, current Node.js guidance recommends TypeScript 5.8 or newer and lists target: "esnext", module: "nodenext", rewriteRelativeImportExtensions, erasableSyntaxOnly, and verbatimModuleSyntax as suitable settings. These are for the TypeScript toolchain, not runtime configuration for Node. noEmit is optional if the project only executes .ts files; it is unnecessary when you intend to produce distributable .js output.
Best Value
Choose built-in stripping or a TypeScript runner
Built-in stripping is a good fit for scripts or applications that use erasable syntax, have runtime-resolvable imports, and do not rely on TypeScript transforms or compiler path rewriting. It removes the need for a separate runtime transpiler for that supported subset, while leaving static checking and any needed distribution build as separate choices.
If your project needs broader TypeScript syntax transformation or tsconfig.json behavior, use a third-party runner. Node.js documents tsx as one option; it is not the only available library.
Quick Recap
| Workflow | Syntax coverage | Configuration | Separate step |
|---|---|---|---|
| Node.js built-in stripping | Erasable TypeScript syntax; runtime-transform features such as enums and parameter properties are outside stripping-only support. | Node ignores tsconfig.json; imports and modules must follow Node’s runtime rules. |
No separate runtime transpiler for supported syntax. Run a checker separately if you want static type validation. |
Third-party runner such as tsx |
Use when your code needs TypeScript transforms beyond erasable syntax; confirm the chosen runner’s supported features. | Node.js documents tsx for projects needing full TypeScript support and tsconfig.json behavior. |
Run through the tool, for example npx tsx your-file.ts or node --import=tsx your-file.ts. Type checking remains a distinct task unless your workflow explicitly performs it. |
| Compile with TypeScript | Use the TypeScript compiler when you need emitted JavaScript output or compiler transforms. | Compiler options are applied by TypeScript, not by Node’s native stripping. | Compilation is a separate build step that produces JavaScript for Node.js to run. |
Set up a practical direct-execution workflow
- Check your Node.js release. Use a release line with stable type stripping, such as Node.js v24.12.0 or later in the v24 line, or v25.2.0 or later in the v25 line.
- Run the entry point. Use
node app.ts. If Node reports unsupported TypeScript syntax, identify whether the file uses a runtime transform feature before changing the code or tool. - Make imports explicit. Include runtime-resolvable file extensions in relative imports and mark type-only imports with
type. - Keep checking separate. Add a TypeScript check such as
npx tsc --noEmitif you want static type validation; Node’s direct execution does not provide it. - Switch runners when needed. If the project depends on transforms or compiler configuration Node ignores, install
tsxas a development dependency, then runnpx tsx your-file.tsornode --import=tsx your-file.ts.
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.




