diff --git a/packages/playwright-core/src/utils/dependencies.ts b/packages/playwright-core/src/utils/dependencies.ts index 51e692f84c248..f28b94308baf6 100644 --- a/packages/playwright-core/src/utils/dependencies.ts +++ b/packages/playwright-core/src/utils/dependencies.ts @@ -21,6 +21,7 @@ import childProcess from 'child_process'; import * as utils from './utils'; import { buildPlaywrightCLICommand } from './registry'; import { deps } from './nativeDeps'; +import { parseOSReleaseText } from './ubuntuVersion'; const BIN_DIRECTORY = path.join(__dirname, '..', '..', 'bin'); @@ -53,6 +54,10 @@ export async function installDependenciesWindows(targets: Set, } export async function installDependenciesLinux(targets: Set, dryRun: boolean) { + const osReleaseText = await fs.promises.readFile('/etc/os-release', 'utf8'); + const fields = parseOSReleaseText(osReleaseText); + if (fields.get('id') !== 'ubuntu') + throw new Error(`Unsupported Linux distribution, only Ubuntu is supported got ${fields.get('id')}!`); const libraries: string[] = []; for (const target of targets) { const info = deps[utils.hostPlatform];