Node.js Visual Studio代码和调试模式

Node.js Visual Studio代码和调试模式,node.js,debugging,visual-studio-code,Node.js,Debugging,Visual Studio Code,我在路径/home/***/Downloads/main.js中有一个小js文件。此文件的内容是: console.log("Hello, world") 我的launch.json文件如下所示: { "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "node", "request": "launch", "program": "${w

我在路径/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
    }
]
}

但我仍然得到以下错误:

程序'nodejs/home/matan/Downloads/main.js'不是绝对路径;考虑将'${WorkStudioOb}/'作为前缀,以使其绝对值。

你知道我做错了什么吗

变化

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

"cwd": "${workspaceRoot}"