2021年1月3日星期日

How to run Nodemon with Typescript in debug mode in Webstorm

I have a very basic express server setup with NodeJS/Express + Nodemon. I'm using Webstorm as my IDE. When running the debug/inspect script, my application is throwing a compile-time error. Following the instructions here, and cognizant of the post here, my (simplified) package.json looks like this:

"scripts": {      "test": "echo \"Error: no test specified\" && exit 1",      "dev": "nodemon src/app.ts",      "debug": "nodemon --inspect=127.0.0.1:9229 src/app.ts"    },  "devDependencies": {      "@types/express": "^4.17.9",      "@types/node": "^14.14.19",      "nodemon": "^2.0.6",      "ts-node": "^9.1.1",      "typescript": "^4.1.3"    }  

When I run npm run debug I receive the following error:

enter image description here

I've also tried the following, all with the same result:

  • "debug": "nodemon --inspect src/app.ts"
  • "debug": "nodemon --inspect=0.0.0.0:9229 src/app.ts"

Any ideas why this error is occurring? The command npm run dev does not generate an error.

Thanks!

https://stackoverflow.com/questions/65556560/how-to-run-nodemon-with-typescript-in-debug-mode-in-webstorm January 04, 2021 at 09:06AM

没有评论:

发表评论