Skip to content

Commit 85c32dc

Browse files
committed
examples: fix
1 parent 6fb11ad commit 85c32dc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/examples/build.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ function buildAndInstallPlaywrightBdd() {
2323
fs.rmSync('node_modules', { recursive: true });
2424
// install playwright-bdd with peer dependencies (Playwright)
2525
// install typescript + @types/node to be able to run tsc in examples
26-
runCmd(`npm install --no-save ../${generatedTar} typescript @types/node`, { cwd });
26+
runCmd(
27+
`npm install --no-save ../${generatedTar} typescript @types/node@${getMajorNodeVersion()}`,
28+
{ cwd },
29+
);
2730
// install playwright browsers
2831
runCmd(`npx playwright install --with-deps chromium`, { cwd });
2932
} else {
@@ -39,3 +42,7 @@ function runCmd(cmd, opts = {}) {
3942
logger.log(`Running: ${cmd}`);
4043
execSync(cmd, { ...opts, stdio: 'inherit' });
4144
}
45+
46+
function getMajorNodeVersion() {
47+
return process.versions.node.split('.')[0];
48+
}

0 commit comments

Comments
 (0)