From b2bc1ed6b1cf29c410e7ef81ecc08d80664da9de Mon Sep 17 00:00:00 2001 From: Jude Gao Date: Tue, 29 Oct 2024 09:39:36 -0400 Subject: [PATCH] Fix swc version mismatch when checking out an older version (#71978) --- scripts/install-native.mjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/install-native.mjs b/scripts/install-native.mjs index 496ffd1fd22c0..86a841bc946aa 100644 --- a/scripts/install-native.mjs +++ b/scripts/install-native.mjs @@ -43,21 +43,21 @@ import fsp from 'fs/promises' name: 'dummy-package', version: '1.0.0', optionalDependencies: { - '@next/swc-darwin-arm64': 'canary', - '@next/swc-darwin-x64': 'canary', - '@next/swc-linux-arm64-gnu': 'canary', - '@next/swc-linux-arm64-musl': 'canary', - '@next/swc-linux-x64-gnu': 'canary', - '@next/swc-linux-x64-musl': 'canary', - '@next/swc-win32-arm64-msvc': 'canary', - '@next/swc-win32-x64-msvc': 'canary', + '@next/swc-darwin-arm64': nextVersion, + '@next/swc-darwin-x64': nextVersion, + '@next/swc-linux-arm64-gnu': nextVersion, + '@next/swc-linux-arm64-musl': nextVersion, + '@next/swc-linux-x64-gnu': nextVersion, + '@next/swc-linux-x64-musl': nextVersion, + '@next/swc-win32-arm64-msvc': nextVersion, + '@next/swc-win32-x64-msvc': nextVersion, }, packageManager, } fs.writeFileSync(path.join(tmpdir, 'package.json'), JSON.stringify(pkgJson)) fs.writeFileSync(path.join(tmpdir, '.npmrc'), 'node-linker=hoisted') - let { stdout } = await execa('pnpm', ['add', 'next@canary'], { + let { stdout } = await execa('pnpm', ['add', `next@${nextVersion}`], { cwd: tmpdir, }) console.log(stdout)