From df7906d92aed20f9eef948609837bfa5098dd82c Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 10 Oct 2022 11:34:25 -0800 Subject: [PATCH] cherry-pick(#17959): chore: better integrity error message --- packages/playwright-core/src/cli/cli.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/playwright-core/src/cli/cli.ts b/packages/playwright-core/src/cli/cli.ts index 1bf39847779c6..d5a844b762ce4 100755 --- a/packages/playwright-core/src/cli/cli.ts +++ b/packages/playwright-core/src/cli/cli.ts @@ -329,11 +329,11 @@ if (!process.env.PW_LANG_NAME) { require('playwright'); hasPlaywrightPackage = true; } catch {} + const strayPackage = hasPlaywrightPackage ? 'playwright' : 'playwright-core'; console.error(wrapInASCIIBox([ - `Playwright Test compatibility check failed:`, - `@playwright/test version '${pwTestVersion}' does not match ${hasPlaywrightPackage ? 'playwright' : 'playwright-core'} version '${pwCoreVersion}'!`, - `To fix this either align the versions or only keep @playwright/test since it depends on playwright-core.`, - `If you still receive this error, execute 'npm ci' or delete 'node_modules' and do 'npm install' again.`, + `Playwright Test integrity check failed:`, + `You have @playwright/test version '${pwTestVersion}' and '${strayPackage}' version '${pwCoreVersion}' installed!`, + `You probably added '${strayPackage}' into your package.json by accident, remove it and re-run 'npm install'`, ].join('\n'), 1)); process.exit(1); }