Closed i-Lucas closed 6 months ago
And if you repeat this test without nodemon and use node (or TS or what have you) directly, what do you see? (If it repeats - you'll need to include information to replicate)
This issue is related with ts-node
. Take a look at this thread; https://github.com/TypeStrong/ts-node/issues/2094
I fixed it by running like below;
nodemon --exec node --loader ts-node/esm .filename.ts
node version: 20.10.0
@Salamante is this worth adding to the FAQ or is this a bug in ts-node
?
@remy I think It's safe to say this is a bug in ts-node
.
Hello. I noticed that this problem happens when I am using a node version higher than 18.17.0 LTS
The error occurs when executing the command 'nodemon filename.ts'
Nodemon TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
System: Ubuntu 22.04.3 LTS. nodemon: ^3.0.2 docker: no
When changing the system node version to v18.17.0, the nodemon executes the .ts file normally.