Get error with amplify

1

I use npm i -g @aws-amplify/cli@4.24

and I get error like that.

I don't know how to configure to upgrade nodejs16

Resource Name: amplify-bookstorev2-9-UpdateRolesWithIDPFuncti-CgaylzF7zTpg (AWS::Lambda::Function) Event Type: create Reason: Resource handler returned message: "The runtime parameter of nodejs10.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs16.x) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: b810b8f2-91de-404f-9f19-80a5e4db2051)" (RequestToken: ba443fee-fe0f-c7a9-f902-f050709c77f5, HandlerErrorCode: InvalidRequest)

질문됨 2년 전290회 조회
2개 답변
0

Hi,

It seems that a Lambda function in your Amplify project has an old unsupported Node.js version configured. I assume the error message you see is triggered during amplify publish? When you created the amplify project (maybe you cloned it from a sample?) or added the lambda function to your amplify project (e.g with amplify function add), nodejs10.x was the current version. Since AWS Lambda does not support nodejs10.x anymore you will have to update the configured Node.js version in your amplify project. For a Lambda function with the name YOUR-FUNCTION-NAME, you can find the cloudformation template amplify uses at amplify/backend/function/YOUR-FUNCTION-NAME/YOUR-FUNCTION-NAME-cloudformation-template.json. Open this file and set the Runtime property in the LambdaFunction resource accordingly. For instance to the currently latest supported version nodejs16.x:

"Resources": {
  "LambdaFunction": {
      ...
      "Properties": {
        "Runtime": "nodejs16.x", // Runtime now set to 16.x
        "Layers": [],
      }
      ...
    }
  },
}

The full documentation can be found here: https://docs.amplify.aws/guides/functions/configuring-lambda/q/platform/js/

profile pictureAWS
답변함 2년 전
  • so this answer doens't solve the problem

0

Hi,

we have absolutely the same problem. We have lambda function which is generated automatically (its not our specific custom lambda) for our amplify APP with name "amplify-shorten-amplify-d-UpdateRolesWithIDPFuncti-5ECL5F9LIAZJ" but we don't have this function in our backend folder. Seems amplify automatically generates this function somehow. And we are not able to modify the NodeJS version for it as a result.

We are using aws-amplify/cli@7.6.15

I tried to update amplify to one of the latest popular versions 10.5.2. After that when I do "amplify env pull --restore" I still do not get any changes which could me allow to update NodeJS version for lambda containing substring "UpdateRolesWithIDPFuncti"

on the web I couldn't get any answers. Maybe this topic can help to understand better the problem. https://github.com/aws-amplify/amplify-cli/issues/5168

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠