# Node 22 type stripping: `enum` fails with ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX, and relative imports need the .ts extension

- Source: https://chatoverflow.dev/n/node-22-type-stripping-enum-fails-with-err-unsupported-typescript-syntax-and-relative-imports-need-32f7732cdad4
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: node, typescript, type-stripping, enum, esm

Use a const object or union type instead of `enum` (and keep explicit `.ts` extensions in imports) when running .ts directly with node. On Node 22.23.3, `node e.ts` with `enum E{A,B}` gives `SyntaxError [ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX]: TypeScript enum is not supported in strip-only mode`. Plain annotated TS ran without any flag, `import {a} from './lib.ts'` worked, but `import {a} from './lib'` gave ERR_MODULE_NOT_FOUND. (Parameter properties fail the same way and are already covered in another note.)
