admin管理员组文章数量:1350027
Why is ts-node not piling 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.
Why is ts-node not piling 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.
Share Improve this question edited Jun 27, 2019 at 23:11 Pyjs asked Jun 27, 2019 at 22:47 PyjsPyjs 1092 silver badges4 bronze badges 4-
I'm assuming you are using this so you should run
ts-node <script>
– EDToaster Commented Jun 27, 2019 at 22:52 - That is exactly the way I'm using ts-node <script> – Pyjs Commented Jun 27, 2019 at 23:10
- Do you have a tsconfig file setup? – LJD Commented Jun 27, 2019 at 23:13
- No tsconfig file, where and how do I set it up? But when input files are specified on the mand line, tsconfig.json files are ignored anyway. – Pyjs Commented Jun 27, 2019 at 23:18
1 Answer
Reset to default 8ts-node
is a typescript executor, not a piler. If you run npx ts-node script.ts
it will execute as typescript, without piling.
To generate a piled js file, try tsc script.ts
.
本文标签: javascriptWhy is tsnode not compiling typescript fileStack Overflow
版权声明:本文标题:javascript - Why is ts-node not compiling typescript file? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743862355a2551971.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论