Visual studio code 无法调试VSCode中的嵌套js应用程序
我尝试调试我的nestjs应用程序,我遵循本文,但仍然无法调试该应用程序 这是我的launch.jsonVisual studio code 无法调试VSCode中的嵌套js应用程序,visual-studio-code,nestjs,vscode-debugger,Visual Studio Code,Nestjs,Vscode Debugger,我尝试调试我的nestjs应用程序,我遵循本文,但仍然无法调试该应用程序 这是我的launch.json { "type": "node", "request": "launch", "name": "Debug Nest Framework", "args"
{
"type": "node",
"request": "launch",
"name": "Debug Nest Framework",
"args": [
"${workspaceFolder}/api/src/main.ts"
],
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register"
],
"sourceMaps": true,
"envFile": "${workspaceFolder}/.env",
"cwd": "${workspaceRoot}/api",
"console": "integratedTerminal",
"protocol": "inspector"
}
当我调试应用程序时,似乎开始调试,但在收到此错误后
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
src/companies/companies.service.ts:13:49 - error TS2304: Cannot find name 'Company'.
如何调试此应用程序?您可以使用新应用程序中设置的一个嵌套,而不是设置整个调试脚本
start:debug
映射到nest start--debug
,它启动服务器(如果需要,在构建服务器之后),并添加--insert brk
标志,以便节点知道您需要可用的调试端口。然后您可以使用VSCode
将附加到端口9229
并开始调试。如何导入公司
类?公司是接口公司{id:string;name:string;email:string;boardMembers?:{firstName:string;lastName:string}[];}AFIK您可以使用/node\u modules/.bin/nest start--exec“node--inspect brk”
启动应用程序,并在命令中选择Debug:attach to node processpallet@24sharon好的,但它是如何进口的?另外,要添加到@micael的注释中,您可以使用nest start--debug
(start:debug in the package.json)并将其附加到processWOW nest start--debug just work for me。。。。谢谢