aws-cdk: CDK Deployment crashes: Dockerfile aws-lambda-nodejs/lib/Dockerfile has unsupported version of NodeJs 14 for new pnpm version

Hi there,

it is unfortunately not possible to deploy aws cdk chages since today. pnpm dependency was updated today to the latest version v8. (GithubV8ReleaseLink)

pnpm v8 is not compatible with Node.js v. 14 (see https://pnpm.io/installation#compatibility) The dockerfile aws-lambda-nodejs/lib/Dockerfile uses image: ARG IMAGE=public.ecr.aws/sam/build-nodejs14.x

Expected Behavior

Deployment should be completed without error code

Current Behavior

Error: Process completed with exit code 1. CI/CD pipeline is down.

Reproduction Steps

Logs:

Status: Downloaded newer image for public.ecr.aws/sam/build-nodejs14.x:latest
 ---> 9c9804a54385
Step 3/13 : RUN npm install --global yarn@1.22.5
 ---> Running in 5b593ca94cf4
/var/lang/bin/yarn -> /var/lang/lib/node_modules/yarn/bin/yarn.js
/var/lang/bin/yarnpkg -> /var/lang/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.22.5
added 1 package in 0.36s
Removing intermediate container 5b593ca94cf4
 ---> a10828479684
Step 4/13 : RUN npm install --global pnpm
 ---> Running in add6e6fa94f7
/var/lang/bin/pnpm -> /var/lang/lib/node_modules/pnpm/bin/pnpm.cjs
/var/lang/bin/pnpx -> /var/lang/lib/node_modules/pnpm/bin/pnpx.cjs
npm WARN notsup Unsupported engine for pnpm@8.0.0: wanted: {"node":">=16.14"} (current: {"node":"14.21.3","npm":"6.14.18"})
npm WARN notsup Not compatible with your version of node/npm: pnpm@8.0.0

+ pnpm@8.0.0
...

Step 10/13 : RUN mkdir /tmp/pnpm-cache &&     chmod -R 777 /tmp/pnpm-cache &&     pnpm config --global set store-dir /tmp/pnpm-cache
 ---> Running in c886e7f701c2
ERROR: This version of pnpm requires at least Node.js v16.4
The current version of Node.js is v14.21.3

Possible Solution

Please update public.ecr.aws/sam/build-nodejs14.x:latest into v16.4.

Additional Information/Context

No response

CDK CLI Version

2.70.0

Framework Version

No response

Node.js Version

v18.13.0

OS

macOs

Language

Typescript

Language Version

Version 5.0.2

Other information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 17 (4 by maintainers)

Most upvoted comments

We just merged a fix to this today https://github.com/aws/aws-cdk/pull/24821. We are working on getting this released.

in my case I was able to solve this by changing any places where we were using Runtime.NODEJS_14_X into Runtime.NODEJS_16_X. Obviously won’t be as easy for everybody, but check if you’re explicitly using node 14 in your code and if switching to 16 does the job

In my case, the problem was solved by specifically setting the runtime in the NodeJSFunction to Runtime.NODEJS_16_X. The default value from the aws-cdk-lib (v2.60.0) is Runtime.NODEJS_14_X if the runtime is not defined and this causes this error.

Also taking our pipelines down.