Unverified Commit 662dcedd authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

install-native.mjs: include `packageManager` field (#54132)

This ensures that corepack uses the correct package manager and version for the tmpdir install as it does for the rest of the repo. It reads the value from the root `package.json`.


Closes WEB-1401
parent f944e984
...@@ -13,6 +13,7 @@ import fs from 'fs-extra' ...@@ -13,6 +13,7 @@ import fs from 'fs-extra'
const { version: nextVersion } = await fs.readJSON( const { version: nextVersion } = await fs.readJSON(
path.join(cwd, 'packages', 'next', 'package.json') path.join(cwd, 'packages', 'next', 'package.json')
) )
const { packageManager } = await fs.readJSON(path.join(cwd, 'package.json'))
try { try {
// if installed swc package version matches monorepo version // if installed swc package version matches monorepo version
...@@ -51,6 +52,7 @@ import fs from 'fs-extra' ...@@ -51,6 +52,7 @@ import fs from 'fs-extra'
'@next/swc-win32-ia32-msvc': 'canary', '@next/swc-win32-ia32-msvc': 'canary',
'@next/swc-win32-x64-msvc': 'canary', '@next/swc-win32-x64-msvc': 'canary',
}, },
packageManager,
} }
await fs.writeFile( await fs.writeFile(
path.join(tmpdir, 'package.json'), path.join(tmpdir, 'package.json'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment