Having compiled my TypeScript project successfully, I intended to run it in VS Code\'s debug mode using ts-node
. Problem is, ts-node
can\'t find
I spent way to much time on this issue tried almost everything like adding to typeRoots my typings folder, creating typing folder with structure typings/module/index.d.ts but nothing worked out so now I've figured it out now what the above answer meant
With a new version of ts-node I've changed for my project's scripts:
ts-node@6: ts-node src/index.ts
ts-node@7: ts-node --files src/index
So your script will be changed to something like below
"scripts": {
"dev": "nodemon --exec ts-node --files src/index",
}
With the above in action your compile time increase a lot but I couldn't spend more time on this so I'm sticking to the above.
You also might like to visit https://github.com/TypeStrong/ts-node#help-my-types-are-missing.