我正在使用VS code开发AWS Lambda函数,我开始使用无服务器框架和无服务器离线库,但我无法使用VS Code的调试模式来本地调试代码。
我参考了许多网站,以下是其中之一:https://medium.com/@OneMuppet_/debugging-lambada-functions-locally-in-vscode-with-actual-break-points-deee6235f590
我的项目结构如下:

Package.json

launch.json

当我开始调试时,我得到了以下错误:

有没有人能指导一下,正确的配置?
发布于 2020-01-24 17:31:32
在package.json添加调试脚本中:
"scripts": {
.......
"debug": "node --inspect node_modules/serverless/bin/serverless offline -s dev",
.........
}VS代码lunch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"name": "Serverless",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"debug"
],
"port": 9229
}
]
}然后从VS代码开始调试
发布于 2019-04-30 10:53:53
您看到的警告是一个弃用警告;the legacy debugger (--debug) has been deprecated since Node 7.7.0。将节点调试器附加到无服务器脱机状态的正确方法是使用--inspect
node --inspect $(npm bin)/sls offline starthttps://stackoverflow.com/questions/55897150
复制相似问题