-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
I am executing the AWS Lambda S3 tutorial from https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html
`I have installed node.js v12 on an ec2 Amazon Linux v2 instance. After following all the instructions in the tutorial, I get the belowerror in the CloudWatch error logs.
The code is available on the tutorial page.
P.S.: The code was running properly when AWS lambda was supporting node.js v4 runtime. Hence I assume the error is due to some change in Syntax.
'{
"errorType": "Runtime.UserCodeSyntaxError",
"errorMessage": "SyntaxError: Unexpected token =>",
"stack": [
"Runtime.UserCodeSyntaxError: SyntaxError: Unexpected token =>",
" at _loadUserApp (/var/runtime/UserFunction.js:98:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object. (/var/runtime/index.js:45:30)",
" 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 Function.Module.runMain (internal/modules/cjs/loader.js:831:12)",
" at startup (internal/bootstrap/node.js:283:19)"
]
}`