Upgrade NodeJS on CodeCatalyst action runners

0

I needed to update CDK to get NodeJS > 16 on my lambda functions. Now the cdk actions won't work because the action runners are all NodeJS 16. Am I missing some way of upgrading NodeJS on the action runner?

已提問 2 個月前檢視次數 400 次
3 個答案
0
已接受的答案

I found a work around for this issue. There's a version of aws-cdk-lib that will run on node 16 but supports creating node 18 lambdas. Here's the fix:

npm install aws-cdk-lib@2.51.0
已回答 1 個月前
0

setup-node action in your GitHub Actions workflow allows you to specify the Node.js version that you wish to run in your workflow.

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
  with:
    node-version: '18' # Specify the Node.js version here
- run: npm install
- run: npm test
profile picture
專家
已回答 2 個月前
  • Codecatalyst actions don't seem to be 1:1 with github actions. I just tried using nvm to update the node version (see below). But now the build complains that "GLIBC_2.27" and "GLIBC_2.28" are not found (required by node). This seems to be a problem with the image that is used for Codecatalyst action runners.

    Configuration:
      Steps:
        - Run: echo "Building Backend Artifacts..."
        - Run: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
        - Run: . ~/.nvm/nvm.sh && nvm install 18
    
0

Hi Robert - I'm glad you were able to find an answer. Were you trying to interact with cdk via a build action? Or were you using the cdk-deploy action in CodeCatalyst? If you are using a build action we recently released a new runtime image (March-2024) that does have more up to date versions of certain tools.

https://docs.aws.amazon.com/codecatalyst/latest/userguide/build-images.html

It would also be good to know what CDK construct you are using to construct your Lambda functions.

AWS
管理員
AWS-Jay
已回答 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南