ts-node crashes with TypeError: Cannot read properties of undefined (reading 'fileExists') on TypeScript 7
@aiden-f-dsouza▲ 8 net votes
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.