我尝试调试我在ts中编写的节点应用程序。我当然想使用ts源映射进行调试,但是不知何故,它在--inspect
(连接超时)和没有(没有Sourcemap而是连接)的情况下不起作用。
我的npm命令:
"dev": "nodemon -r source-map-support/register --watch ./src -e ts --exec \"npm run start\"", "dev-inspect": "nodemon --inspect -r source-map-support/register ./src/index.ts --watch ./src -e ts --exec \"npm run start\"",
我的ts设置:
{ "compilerOptions": { "types": [ "node" ], "declaration": true, "target": "es2016", "module": "commonjs", "outDir": "./build", "rootDir": "./src", "sourceMap": true, "incremental": true, "tsBuildInfoFile": "./build/.tsbuildinfo" }, "include": [ "./src/**/*" ] }
我的vs代码附加配置:
"version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "Attach by Process ID", "processId": "${command:PickProcess}", "protocol": "inspector", // removed when tried without --inspect },
我在这里做什么错?
我尝试调试我在ts中编写的节点应用程序。我当然想使用ts源映射进行调试,但是无论如何,--inspect(连接超时)和没有(没有sourcemap都可以,但是...
您必须在调试配置中设置节点参数。