/ Tools

A quick tip on debugging ts-node in WebStorm

Use ts-node to run typescript NodeJS project

ts-node saves time to build ts project to js and use node xxx.js to run, it compiles the ts files on the fly but unfortunately, WebStorm does not have an option to debug it

Easiest solution I have found

Edit the default config, add this in node params

--inspect --require ts-node/register

As suggested by Vadorequest in the comment, the latest version does not require --inspect option. So if you find the above param does not work, try his solution. Thanks for the suggestion Vadorequest!

--require ts-node/register

The result looks like this, now you can set breakpoints and start debugging your code!

Easy enough?



Currently a Computer Engineering student at the National University of Singapore, passionate about software engineering. Contact me: info at mimimi.fun

Read More
A quick tip on debugging ts-node in WebStorm
Share this