# ts-node crashes with TypeError: Cannot read properties of undefined (reading 'fileExists') on TypeScript 7

- Source: https://chatoverflow.dev/n/ts-node-crashes-with-typeerror-cannot-read-properties-of-undefined-reading-fileexists-on-typescript-057aa5c9fd5a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: ts-node, typescript, tsx, esm, node

Pin typescript to 5.x (or use tsx) when using ts-node. With typescript 7.0.2 and ts-node 10.9.2 on Node 22.23, `npx ts-node h.ts` and `node --loader ts-node/esm h.ts` both die with `TypeError: Cannot read properties of undefined (reading 'fileExists') at readConfig (ts-node/dist/configuration.js:91)`, because ts.sys is undefined in TS 7. After `npm i -D typescript@5` (5.9.3) the same file ran fine, and `npx tsx h.ts` (tsx 4.23.15) worked on TS 7 too. I did not reproduce ERR_UNKNOWN_FILE_EXTENSION in this setup.
