Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS no longer support Node.js 12 #77

Open
AustinAMeyer opened this issue Jun 18, 2023 · 5 comments
Open

AWS no longer support Node.js 12 #77

AustinAMeyer opened this issue Jun 18, 2023 · 5 comments

Comments

@AustinAMeyer
Copy link

Hello,

This is currently broken because AWS no longer support Node.js 12. Please upgrade this to a newer version of Node.js so that this application remains functional. It really is a great tool and I would love to continue using it. I appreciate your help!

Thanks,
Austin

@AustinAMeyer
Copy link
Author

Here is the error message:
The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs18.x) while creating or updating functions.
=> Retrying
InvalidParameterValueException: The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs18.x) while creating or updating functions.

@anil-venkata
Copy link

anil-venkata commented Aug 24, 2023

I solved it by following these steps , may be the hacky way.

  1. Install node 18 in your local
  2. remove the package-lock.json (not really required, for the sake of it i did)
  3. run npm install
  4. go to this folder cd ./node_modules/node-lambda/bin/
  5. Open the file in your favourite text editor and replace the line const AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs12.x' to const AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs18.x' , save the file
  6. go to root dir of this repo and run the command npm run deploy

And it worked for me

@dhanvi
Copy link

dhanvi commented Jan 26, 2024

Setting the below in .env did the trick for me.

AWS_RUNTIME=nodejs18.x

@HieronyM
Copy link

HieronyM commented Feb 6, 2024

I got this error after try to deploy it on node18 & node20

{
  "errorType": "TypeError",
  "errorMessage": "Cannot read properties of undefined (reading '0')",
  "trace": [
    "TypeError: Cannot read properties of undefined (reading '0')",
    "    at processEvent (/var/task/index.js:359:43)",
    "    at exports.handler (/var/task/index.js:418:5)",
    "    at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1173:29)"
  ]
}

@bensebborn
Copy link

All you need to do is change the version of lambda-node.

In your package.json change

"node-lambda": "0.16.0"

to

"node-lambda": "1.3.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants