Install the compiler per project so everyone uses the same version: npm 2,036 install -D typescript, then npx tsc --init writes a starter tsconfig.json (Project Configuration). npx tsc checks the project and emits JavaScript; npx tsc --noEmit only checks. You can also skip the build step and run .ts files directly, because several runtimes now strip types on the fly (runtimes are introduced in Engines and Runtimes):
| Tool | Run a file | Type-checks? | How it works |
|---|---|---|---|
| tsc 7.0.2 | npx tsc | Yes | Emits .js files |
| tsx 4.23 12,162 | npx tsx app.ts | No | Node.js 2,131 plus esbuild 126 ; tsx watch |
| Node.js 22.18+ | node app.ts | No | Blanks out types with spaces |
| Deno 2.9 60,577 | deno run app.ts | With --check | Bundles TypeScript 6.0.3 for deno check |
| Bun 1.4 73,307 | bun app.ts | No | Native transpiler |
Node.js enables type stripping by default since 23.6 and 22.18, and marked it stable in 25.2 and 24.12. It replaces annotations with whitespace, so line and column numbers stay correct without source maps, and it refuses syntax that would need generated JavaScript: enum, namespace with code, parameter properties and import = aliases. It also ignores tsconfig.json and needs import type and full file extensions (./cart.ts). Here one enum meets four runtimes:
$ node status.ts 2>&1 | grep SyntaxError
SyntaxError [ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX]: TypeScript enum is not supported in strip-only mode
$ npx tsx status.ts
1
$ deno run status.ts
1
$ bun status.ts
1status.ts declares enum Status { Active, Archived } and logs Status.Archived. Set "erasableSyntaxOnly": true and "verbatimModuleSyntax": true in tsconfig.json so tsc flags such syntax (error TS1294) before Node.js does. Decorators also survive stripping, and Node.js cannot run them yet (Decorators), while tsx and Deno transform them.