gpt4 book ai didi

node.js - Visual Studio 代码和 Debug模式

转载 作者:太空宇宙 更新时间:2023-11-04 00:41:47 25 4
gpt4 key购买 nike

我在路径/home/***/Downloads/main.js 中有一个小的 js 文件。该文件的内容是:

console.log("Hello, world")

我的 launch.json 文件如下所示:

{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/main.js",
"stopOnEntry": false,
"args": [],
"cwd": "/home/matan/Downloads",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
}
]

}

但我仍然收到以下错误:

Program 'nodejs /home/matan/Downloads/main.js' is not an absolute path; consider adding '${workspaceRoot}/' as a prefix to make it absolute.

你知道我做错了什么吗?

最佳答案

改变

"cwd": "/home/matan/Downloads"

"cwd": "${workspaceRoot}"

关于node.js - Visual Studio 代码和 Debug模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36372076/

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