If you want to run "ts-node" in production with ESM, then use: "tsc --noEmit && node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only src/main.ts" (see github.com/TypeStrong/ts-node/issues/104#issuecomment-1941702624)
Thank you, Daniel! It's important for me to not only show the "how" but also explain the "why". I try to follow this principle in all my TypeScript tutorials. 😀
If you want to run "ts-node" in production with ESM, then use: "tsc --noEmit && node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only src/main.ts" (see github.com/TypeStrong/ts-node/issues/104#issuecomment-1941702624)
This is easily the most underrated TS channel on RUclips. Thank you for your videos Benny.
Thank you! I also think the same. 😅 Btw. I made an app for programmers: apps.apple.com/app/id659282498
Thank you Benny! Amazing video, not only sharing the solution but explaining why it's the best solution available at the moment! Tks a lot
Thank you, Daniel! It's important for me to not only show the "how" but also explain the "why". I try to follow this principle in all my TypeScript tutorials. 😀
Thank you so much for your explanation, it helped me a lot
I’ve been using vite-node as my ts-node alternative. Seems to work really well out of the box with ESM. And nodmon etc. No issues.
Thanks for sharing this with us. Does it also show you stacktraces when using Node.js v20?
Thanks but what if i have to use nodemon
When using nodemon, you can create a "nodemon.json" file in your repository and use the commands in the "exec" section.
how to do it with nodemon "node --loader ts-node/esm && nodemon ./index.ts"
Will you get type checking when doing this?