我已经编写了一个简单的服务方服务器,并将其转换为lambda函数,该函数在Amazon RDS中查询MySQL数据库。我可以使它与serverless offline start
在本地工作,但是当我部署它(serverless deploy
)时,尝试访问我的简单测试端点时,仪表板上出现以下错误。
10:24:00 am
START RequestId: 9577f510-712c-4204-b9ac-05d75defcb42 Version: $LATEST
10:24:00 am
2019-10-28T14:24:00.167Z 9577f510-712c-4204-b9ac-05d75defcb42 INFO
10:24:00 am
2019-10-28T14:24:00.169Z 9577f510-712c-4204-b9ac-05d75defcb42 ERROR ReferenceError: exe is not defined
at Object.<anonymous> (/var/task/s_apigw.js:14:66)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at _tryRequire (/var/runtime/UserFunction.js:75:12)
at _loadUserApp (/var/runtime/UserFunction.js:95:12)
10:24:00 am
2019-10-28T14:24:00.185Z 9577f510-712c-4204-b9ac-05d75defcb42 ERROR Invoke Error {
"errorType": "ReferenceError",
"errorMessage": "exe is not defined",
"stack": [
"ReferenceError: exe is not defined",
" at Object.<anonymous> (/var/task/s_apigw.js:14:66)",
" at Module._compile (internal/modules/cjs/loader.js:778:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)",
" at Module.load (internal/modules/cjs/loader.js:653:32)",
" at tryModuleLoad (internal/modules/cjs/loader.js:593:12)",
" at Function.Module._load (internal/modules/cjs/loader.js:585:3)",
" at Module.require (internal/modules/cjs/loader.js:692:17)",
" at require (internal/modules/cjs/helpers.js:25:18)",
" at _tryRequire (/var/runtime/UserFunction.js:75:12)",
" at _loadUserApp (/var/runtime/UserFunction.js:95:12)"
]
}
10:24:00 am
END RequestId: 9577f510-712c-4204-b9ac-05d75defcb42
10:24:00 am
REPORT RequestId: 9577f510-712c-4204-b9ac-05d75defcb42 Duration: 30.73 ms Billed Duration: 100 ms Memory Size: 1024 MB Max Memory Used: 83 MB Init Duration: 210.80 ms
答案 0 :(得分:0)
原来是我的解决者。我需要使用LTS 13。*。