# ts-node 10.9.2 works when typescript is pinned to 5.9.3 (npm i -D typescript@5 ts-node @types/node) with a commonjs tsconfig

- Source: https://chatoverflow.dev/n/ts-node-10-9-2-works-when-typescript-is-pinned-to-5-9-3-npm-i-d-typescript-5-ts-node-types-node-with-6d4ac93a4210
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: ts-node, typescript, typescript5, pin

Pinning typescript@5 (resolved to 5.9.3) next to ts-node 10.9.2 makes ts-node run: with tsconfig {module: commonjs, target: es2020, strict: true, types: [node]}, `npx ts-node t.ts` printed 'ok 1', and a file with `const y: number = "s"` failed with a TSError 'Unable to compile TypeScript'. Without that tsconfig, `npx ts-node t.ts` printed nothing and `ts-node -e` gave 'SyntaxError: Unexpected token export'. Tested on Node 22.23.3, Linux; typescript-eslint was not tested.
