How to run TypeScript files from command line?
I think a quick Google search will lead you to this. The TL;DR is that Node.js can understand JavaScript, but not TypeScript.
Use npx ts-node src/foo.ts to convert and run the TypeScript file in one step, or do it in two steps with tsc (the first option is simpler).