From 90921aabf11b1ad4f127bb7fdf7c04ff1c61628a Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Fri, 16 Jul 2021 18:04:09 -0400 Subject: [PATCH] fix(repo): fix running e2e tests locally with npm 7 (#6400) --- e2e/utils/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/utils/index.ts b/e2e/utils/index.ts index 95622d4b8d..09bfb0d63f 100644 --- a/e2e/utils/index.ts +++ b/e2e/utils/index.ts @@ -610,9 +610,13 @@ export function getPackageManagerCommand({ const publishedVersion = `9999.0.2`; + const [npmMajorVersion] = execSync(`npm -v`).toString().split('.'); + return { npm: { - createWorkspace: `npx create-nx-workspace@${publishedVersion}`, + createWorkspace: `npx ${ + +npmMajorVersion >= 7 ? '--yes' : '' + } create-nx-workspace@${publishedVersion}`, runNx: `npm run nx${scriptsPrependNodePathFlag} --`, runNxSilent: `npm run nx --silent${scriptsPrependNodePathFlag} --`, addDev: `npm install --legacy-peer-deps -D`,