【发布时间】:2020-10-01 15:05:07
【问题描述】:
我已经在我的 Windows 10 系统上安装了 Ubuntu 20.04。在我第一次在 Ubuntu 中运行 VS Code 之前,VS Code 在 Windows 中运行良好。现在,我可以在那里构建我的 C++ 应用程序,但无法调试它。我收到一个警告框,提示“在 PATH 上找不到运行时 'node'。是否安装了 'node'?”
每当我启动 VS Code 时,一个名为“node”的后台进程也会启动,所以我假设 VS Code 会启动它。我的 Ubuntu 安装在 ~/.vscode-server 的各个子目录中有大约八个版本的 node.js。
这是我的 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": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/gametest",
"skipFiles": [
"<node_internals>/**"
]
},
]
}
我尝试安装最新的 nodejs。我不再收到带有未找到消息的警告框,但 VS Code 中的调试控制台现在显示:
/usr/bin/node /home/jon/projects/KSolve/gametest
Debugger listening on ws://127..... (can't copy from debug console window)
For help, ...
/home/jon/projects/KSolve/gametest:1
ELF(three squares)
^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
...
...
Process exited with code 1
【问题讨论】:
-
如果您能提供有关您的 C++ 项目的更多详细信息,将更容易回答您的问题。你在使用 CMake 等吗?
标签: c++ visual-studio-code windows-subsystem-for-linux