How to configure debugger for a NodeJs application using TypeScript?
已回答
I have a Nodejs api written in TypeScript. I'm trying to make the debugger work. I saw some tutorials to do this in WebStorm, but not on the IntelliJ. I've tried my JavaScript Api and worked, I also use with Java and works too. But I couldn't make it work with NodeJs/TypeScript.
When I try to compile it says that I can't use ``import app from "./app"; SyntaxError: Cannot use import statement outside a module```
But when I run in the terminal it works fine.
Here is my configs:
Also my package.json
Also I'm compiling with yarn and I'm using IntelliJ Ultimate
I just want to use the debugger breakpoints like I do in Java.
Do I need any package? or something?
请先登录再写评论。
Typescript code can't be run directly, it has to be pre-compiled. Please see Running and debugging TypeScript for instructions on running/debugging Typescript