From e8e4d838f820ee50d3fcf6ae17fb38d8648e9faa Mon Sep 17 00:00:00 2001 From: Cory Hall <43035978+corymhall@users.noreply.github.com> Date: Tue, 28 Mar 2023 13:21:00 -0400 Subject: [PATCH] fix(lambda-nodejs): pnpm no longer supports nodejs14.x (backport #24821) (#24829) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile | 2 +- packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile b/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile index 54969bb5fde2c..21dbeeaaf2072 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/Dockerfile @@ -1,6 +1,6 @@ # The correct AWS SAM build image based on the runtime of the function will be # passed as build arg. The default allows to do `docker build .` when testing. -ARG IMAGE=public.ecr.aws/sam/build-nodejs14.x +ARG IMAGE=public.ecr.aws/sam/build-nodejs18.x FROM $IMAGE # Install yarn diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts index d1b85dfcca2b8..9336d92f58b3a 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/docker.test.ts @@ -1,8 +1,11 @@ import { spawnSync } from 'child_process'; import * as path from 'path'; +const docker = process.env.CDK_DOCKER ?? 'docker'; beforeAll(() => { - spawnSync('docker', ['build', '-t', 'esbuild', path.join(__dirname, '../lib')]); + const process = spawnSync(docker, ['build', '-t', 'esbuild', path.join(__dirname, '../lib')], { stdio: 'inherit' }); + expect(process.error).toBeUndefined(); + expect(process.status).toBe(0); }); test('esbuild is available', () => {