From bb5fced30aeea4f9ba77cb22d4d505e7c71d3a98 Mon Sep 17 00:00:00 2001 From: Syed Taqi Haider Date: Fri, 21 Jul 2023 17:55:20 +0100 Subject: [PATCH] Changed package manager for install-native.mjs to pnpm (#52971) fixes #52970 Yarn 3 has removed the "--force" flag. This can cause issues with building the Next.js repository if Yarn 3 is activated on a development machine (specifically the postinstall script "install-native.mjs"). Using pnpm as the package manager fixes this issue. --- scripts/install-native.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install-native.mjs b/scripts/install-native.mjs index 84b38263143a8..706f8ec0103a3 100644 --- a/scripts/install-native.mjs +++ b/scripts/install-native.mjs @@ -56,7 +56,9 @@ import fs from 'fs-extra' path.join(tmpdir, 'package.json'), JSON.stringify(pkgJson) ) - let { stdout } = await execa('yarn', ['--force'], { cwd: tmpdir }) + let { stdout } = await execa('pnpm', ['install', '--force'], { + cwd: tmpdir, + }) console.log(stdout) let pkgs = await fs.readdir(path.join(tmpdir, 'node_modules/@next')) await fs.ensureDir(path.join(cwd, 'node_modules/@next'))