node.js - 使用断点在可视代码中本地调试 Serverless (Node js)。
问题描述
我是无服务器框架的新手,正在尝试使用断点在可视代码中本地调试无服务器(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-本地功能与无服务器框架和 vs-code-a254e2011010
解决方案
最后,我能够解决问题,我缺少节点路径
{
"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}"
}
}]
}
推荐阅读
- flutter - Flutter:检查设备是否支持 eSim
- keras - 使用自定义 Word2Vec 嵌入而不是 GloVe
- javascript - php pdo 将数组动态插入数据库
- flutter - Flutter obscureText 给出点而不是密码
- magento2 - 相关产品导入在 magento 2 中每次只完成 100 个产品
- pandas - 熊猫提取分层信息?
- python - SQLAlchemy,过滤掉不符合条件的行,但如果不符合条件,则使用该行的相邻列
- excel - 将字符串分成两部分 - VBA
- iis - .Net Core 3.1 API - 到 IIS 的基本部署
- javascript - cypress 中的音频播放