From dd6e0abc1331b8fb20d5a8b5065b5476e54dbb2f Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Wed, 3 Mar 2021 17:40:55 +0100 Subject: [PATCH] fix: pack base-layer with --legacy-peer-deps See https://github.com/aws/aws-sdk-js-v3/issues/2051 --- cdk/helper/lambdas/makeLayerFromPackageJSON.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cdk/helper/lambdas/makeLayerFromPackageJSON.ts b/cdk/helper/lambdas/makeLayerFromPackageJSON.ts index 836ad20166..49b9d66654 100644 --- a/cdk/helper/lambdas/makeLayerFromPackageJSON.ts +++ b/cdk/helper/lambdas/makeLayerFromPackageJSON.ts @@ -56,9 +56,13 @@ export const makeLayerFromPackageJSON__Unsafe = async ({ reporter.progress('base-layer')('Installing dependencies ...') await new Promise((resolve, reject) => { - const p = spawn('npm', ['i', '--ignore-scripts', '--only=prod'], { - cwd: dir, - }) + const p = spawn( + 'npm', + ['i', '--ignore-scripts', '--only=prod', '--legacy-peer-deps'], + { + cwd: dir, + }, + ) p.on('close', (code) => { if (code !== 0) { const msg = `[CloudFormation Layer] npm i in ${dir} exited with code ${code}.`