cherry-pick(#17959): chore: better integrity error message
This commit is contained in:
parent
f87d6f2838
commit
df7906d92a
|
|
@ -329,11 +329,11 @@ if (!process.env.PW_LANG_NAME) {
|
||||||
require('playwright');
|
require('playwright');
|
||||||
hasPlaywrightPackage = true;
|
hasPlaywrightPackage = true;
|
||||||
} catch {}
|
} catch {}
|
||||||
|
const strayPackage = hasPlaywrightPackage ? 'playwright' : 'playwright-core';
|
||||||
console.error(wrapInASCIIBox([
|
console.error(wrapInASCIIBox([
|
||||||
`Playwright Test compatibility check failed:`,
|
`Playwright Test integrity check failed:`,
|
||||||
`@playwright/test version '${pwTestVersion}' does not match ${hasPlaywrightPackage ? 'playwright' : 'playwright-core'} version '${pwCoreVersion}'!`,
|
`You have @playwright/test version '${pwTestVersion}' and '${strayPackage}' version '${pwCoreVersion}' installed!`,
|
||||||
`To fix this either align the versions or only keep @playwright/test since it depends on playwright-core.`,
|
`You probably added '${strayPackage}' into your package.json by accident, remove it and re-run 'npm install'`,
|
||||||
`If you still receive this error, execute 'npm ci' or delete 'node_modules' and do 'npm install' again.`,
|
|
||||||
].join('\n'), 1));
|
].join('\n'), 1));
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue