【发布时间】:2018-05-04 06:20:32
【问题描述】:
根据 AWS 文档,我在本地启动 SAM 是这样的:
$ sam local start-api -d 5858
我的 launch.json 中有以下内容
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to SAM Local",
"type": "node",
"request": "attach",
"address": "localhost",
"port": 5858,
"localRoot": "${workspaceRoot}",
"remoteRoot": "/var/task"
}
]
}
但是当我启动 Visual Studio 调试器时,它说“无法连接到运行时,请确保运行时处于‘旧版’调试模式”
看起来好像很多人在使用 Node.js 6 和 Visual Studio Code 时遇到了这个问题,但我似乎找不到答案……我使用的是 Visual Studio Code 1.18.1 版
我尝试将 "protocol": "Legacy" 添加到 launch.json 配置。我也尝试过使用--debug-port 而不是-d。 我使用的是 Windows 10。不确定问题是否是特定于 Windows 的。
【问题讨论】:
标签: debugging visual-studio-code aws-sam-cli