gpt4 book ai didi

node.js - 在 vscode 中调试/运行 : Program exists

转载 作者:太空宇宙 更新时间:2023-11-04 02:11:12 32 4
gpt4 key购买 nike

我有一个express.js应用程序。

每当我尝试在 vscode 中调试/运行它时,它都会运行并存在。我如何像平常一样保持这个过程的活力?或者我的配置有问题?不会引发任何错误。

"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "www",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"www"
],
"address": "localhost",
"port": 5000,
"stopOnEntry": false,
"cwd": "${workspaceRoot}",
"env": {
...
}
}
]

我的 npm 脚本如下所示:

流 Node www/index.js

我想从 vscode 调试/运行这个脚本,因为我有很多环境变量,显然是出于调试原因。

最佳答案

您可能只需要指定 launch.json 配置的 program 属性。

program - executable or file to run when launching the debugger https://code.visualstudio.com/docs/editor/debugging#_launchjson-attributes

关于node.js - 在 vscode 中调试/运行 : Program exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42045005/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com