gpt4 book ai didi

visual-studio-code - VSCode :/usr/bin/node: bad option: --inspect since last upgrade?

转载 作者:行者123 更新时间:2023-12-02 10:57:27 25 4
gpt4 key购买 nike

我在 Kubuntu 上运行最新的VSCode稳定版本来开发GO程序。自上次更新(VSCode 1.39.0版)以来,我的构建任务不再起作用。我得到的只是调试控制台中的这两行:

/usr/bin/node --inspect=17112 --debug-brk
/usr/bin/node: bad option: --inspect=17112



可悲的是我不知道怎么来的?我最近没有更改项目或任何来源。我也没有在我的任何代码中找到任何--inspect选项。

我首先运行我的makefile,然后执行生成的可执行文件。几个月以来,这种方法非常有效,现在却停止了工作。

这是我的 launch.json :
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type":"node2",
"request": "launch",
"name": "Build and Launch my program",
"program": "",
"args": [],
"preLaunchTask": "make",
"postDebugTask": "execute",
"cwd": "${workspaceFolder}"
}
]
}

这是我的 task.json :
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make",
"type": "shell",
"command": "make",
"args": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "silent"
}
},
{
"label": "execute",
"type": "shell",
"command": "${workspaceFolder}/myExecutable",
"args": [
"-c",
"/tmp/myTemp",
"-i",
"-v",
"-l",
"box.log"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "silent"
}
}
]
}

我已经尝试用node和protocol替换node2,但是它的行为完全一样。好像没关系吗?

最佳答案

我终于用“go”调试器替换了“node”或“node2”调试器。有一个“mode”:“exec”选项允许我简单地执行makefile之前编译的程序。

这是我的工作配置:

launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type":"go",
"request": "launch",
"name": "Build and Launch my executable",
"mode":"exec",
"program": "${workspaceFolder}/myExecutable",
"args": [
"-c",
"/tmp/regibox",
"-i",
"-v",
"-l",
"box.log"
],
"preLaunchTask": "make",
"postDebugTask": "",
"cwd": "${workspaceFolder}"
}
]
}

这是我的 task.json :
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make",
"type": "shell",
"command": "make",
"args": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "silent"
}
}
]
}

这样,我可以简单地执行makefile并使用F5运行生成的可执行文件。当然,这种方式无需调试:-(

关于visual-studio-code - VSCode :/usr/bin/node: bad option: --inspect since last upgrade?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58344212/

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