Menu

1 / 5

Run TypeScript in Node.js Without a Build Step: Type Stripping Tested on Node 22, 24 and 26

DEV Community: webdev·Waseem Anjum·11 days ago
#u30D7RHx
#devtowebdev#devto#dev#node#type
Reading 0:00
15s threshold

Cross-posted from my blog. The original, with any updates, lives on fabwaseem.com .

You can now run a .ts file with plain node app.ts , no tsx , no ts-node , no build step. Type stripping has been on by default since Node.js 22.18.0 and 23.6.0 , and it became stable in Node.js 24.12.0 and 25.2.0 . On Node.js 26 LTS it is simply how Node works.

But "Node runs TypeScript" has sharp edges. Enums fail. Parameter properties fail. Decorators fail. Imports without .ts fail. And Node never checks your types. I tested every one of these on Node.js 22.20.0, 24.22.2 and 26.13.0 , and this post shows the exact errors, the tsconfig.json that catches all of them before runtime, and how startup time compares to tsx and precompiled JavaScript.

How Node.js type stripping works

Node replaces TypeScript type annotations with whitespace and runs what is left as JavaScript.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.