6

Why is ts-node not compiling and executing typescript file? It is used in terminal like "ts-node scriptfile" It just returns a blank line. What is wrong? Thanks for the help.

Pyjs
  • 89
  • 2
  • 4

1 Answers1

4

ts-node is a typescript executor, not a compiler. If you run npx ts-node script.ts it will execute as typescript, without compiling.

To generate a compiled js file, try tsc script.ts.

Andrew Homeyer
  • 7,937
  • 5
  • 33
  • 26