What changes introduced since nodejs 18.19 that cause ts-node fails to work with the error TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.ts”?
This open issue against ts-node has the detailed information. I have tested from node18.19 to nodejs 22 and confirm they all fails to run ts-node.
I went through Node v18.19.0 release notes but I can’t figure out which change caused that. The release note even gave an example od using ts-node, Loaders now apply to subsequent loaders, for example: --experimental-loader ts-node --experimental-loader loader-written-in-typescript.
BTW, I switch to tsx as a workaround.