I am trying to add a debug script in my package.json file. For a plain Node project this code works:
"debug": "node --inspect index.js"
And for Node TypeScript project I did this:
"debug": "ts-node --inspect --require ts-node/register index.ts"
But this gives me error:
Error: Unknown or unexpected option: --inspect
What should I do?
Use the following command to pass the
--inspectoption directly to node as indicated in this ts-node issue.or
So for your example, it would be