gpt4 book ai didi

node.js - 使用断点在可视代码中本地调试 Server less (Node js)。

转载 作者:太空宇宙 更新时间:2023-11-03 23:18:27 25 4
gpt4 key购买 nike

我是无服务器框架的新手,正在尝试使用断点在可视代码中本地调试无服务器(Node js)。

我引用了一些文章,但没有多大帮助。

https://medium.com/@OneMuppet_/debugging-lambada-functions-locally-in-vscode-with-actual-break-points-deee6235f590 https://hackernoon.com/running-and-debugging-aws-lambda-functions-locally-with-the-serverless-framework-and-vs-code-a254e2011010

最佳答案

最后,我能够解决这个问题,我缺少 Node 路径

{
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "launch",
"name": "Debug Local",
"program": "${workspaceFolder}/node_modules/serverless/bin/serverless",
"cwd": "${workspaceRoot}",
"args": [
"invoke",
"local",
"-f",
"functionname",
"--path",
"../test.json", // pass the path of local test event
"--stage",
"AWs envrionment name" // eg: dev,stage, prod etc
],
"env": {
"NODE_PATH": "${cwd}"
}
}]
}

关于node.js - 使用断点在可视代码中本地调试 Server less (Node js)。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52414232/

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