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.
1 Answer 1
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.
answered Dec 24, 2020 at 23:00
Andrew Homeyer
8,13855 gold badges3636 silver badges2626 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
- The Overflow Blog
-
-
- Featured on Meta
-
-
-
Related
Hot Network Questions
- Difference between 'acquit' in Exo 23:7 and Joel 3:21
- 南方 和 南部—different?
- Find all integers n such that the sum of the factorials of its digits equals ⌊√n⌋
- Why do interpretations of quantum phenomena focus on QM rather than QFT?
- Proving an order relation between two concrete real numbers (Lean)
- Was 2023 the first time a person in California was killed in a black bear attack?
- Which objects in a topos such as the étale topos are "classifying spaces" of their fundamental groups?
- A "Great Classic", but also very confusing, SF novel about dreams within dreams within dreams (but very different from the movie “Inception”)
- Can an aspect ratio of of +5 % have an adverse effect on a differential?
- Simplify into reduced form
- Instrumental parts page size, 8.5x11 or 9x12?
- A "crappy" pentagon puzzle
- Let’s go to the pub! Hey, we’re all thirsty but some of us don’t want to get drunk.
- PhD public defense mode before PowerPoint or QuickTime was invented
- Multiple comparisons with uncertain number of tests
- Can I delete the Chrome's OptGuideOnDeviceModel safely? It's taking up 4GB
- 言うとろう: What does it mean?
- When was the last time U.S. Congress overrode a president's veto?
- Destroying the parent when all children are destroyed
- How to resize ext4 without adding more inodes?
- Why "yan" instead of "ian" (or "yian")? ("An", "ban", "can", etc. all end with "-ahn" but confusingly "yan" is pronounced "yen".)
- Can poetry be substantively conducive to philosophy?
- expl3: l3file: \iow_now:Ne... doesn't expand tokens before writing to the stream?
- Is an employee being overpaid an example of "economic rent"?
lang-js
ts-node <script>