Why does the node inspector not start when I am using nodemon and ts-node?
With ts-node 5.0.0 you no longer pass the --inspect flag
the same way. The suggested way is node --inspect -r ts-node/register path/to/ts
. For example:
nodemon --watch src/**/* -e ts,json --exec node --inspect-brk -r ts-node/register src/app.ts
Provide location and port to the inspect option like:
--inspect=0.0.0.0:9200
I just fixed this problem by writing nodemon.json file like this :
{ "restartable": "rs", "ignore": [".git", "node_modules/**/node_modules"], "verbose": true, "execMap": { // [A] "ts": "node --require ts-node/register" }, "watch": ["src/"], "env": { "NODE_ENV": "development" }, "ext": "js,json,ts"}
ref : https://dev.to/oieduardorabelo/nodejs-with-typescript-debug-inside-vscode-and-nodemon-23o7