TypeStrong / ts-node

TypeScript execution and REPL for node.js
https://typestrong.org/ts-node
MIT License
12.83k stars 533 forks source link

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" in Node v21.5.0 #2100

Open cibilex opened 8 months ago

cibilex commented 8 months ago

First of all ,I already looked at https://github.com/TypeStrong/ts-node/issues/1997 and most of other websites to solve the problem but I couldn't.This error is throwed when I try to use in Node v21.5.0.I realized that The problem is node version,when I updated Node version to v19.0.0 it works.Could you please update ts-node to work in new Node versions.

Best regards.

AaronNGray commented 2 months ago

@francip I believe there is a PR. I have not looked at it thought. Anyway best not to be a perfectionist over having a working solution.

ParrotStone commented 1 month ago

Facing same issue. Node v22.4.0

niz11 commented 4 weeks ago

Facing same issue. Node v22.4.0

Same. The quick fix I got from above which is working for me at the moment is: node --no-warnings=ExperimentalWarning --loader ts-node/esm app.ts

egoroof commented 4 weeks ago

fixed for me with https://github.com/privatenumber/tsx