If you're working on this repo and runs pn build && pn sv ../test --install pnpm. It will create a onlyBuiltDependencies instead of allowBuilds because this repo is using pnpm 10.
|
"packageManager": "pnpm@10.33.4+sha512.1c67b3b359b2d408119ba1ed289f34b8fc3c6873412bec6fd264fbdc82489e510fcbecb9ce9d22dae7f3b76269d8441046014bdca53b9979cd7a561ad631b800" |
This can be generalized to any situation where the cwd and the target doesn't have matching versions via https://pnpm.io/package_json#devenginespackagemanager.
It was also bugged on the pnpm side where child process will inherit the parent version but is now fixed.
proposed fix
- pass in cwd
allowBuilds(packages,{cwd})
- make the versions explicit
allowBuilds(packages, {pnpmVersion})
- default to
os.tmpdir()
os.tmpdir() will not fix pnx sv add ..., only pnx sv create ....
export function detectPnpmMajor(): number | undefined {
try {
const out = execSync('pnpm --version', {
encoding: 'utf-8',
stdio: ['ignore', 'pipe', 'ignore'],
+ cwd: os.tmpdir()
});
return coerceVersion(out.trim()).major;
} catch {
return undefined;
}
}
If you're working on this repo and runs
pn build && pn sv ../test --install pnpm. It will create aonlyBuiltDependenciesinstead ofallowBuildsbecause this repo is using pnpm 10.cli/package.json
Line 43 in 311c4d6
This can be generalized to any situation where the
cwdand thetargetdoesn't have matching versions via https://pnpm.io/package_json#devenginespackagemanager.It was also bugged on the
pnpmside where child process will inherit the parent version but is now fixed.proposed fix
allowBuilds(packages,{cwd})allowBuilds(packages, {pnpmVersion})os.tmpdir()os.tmpdir()will not fixpnx sv add ..., onlypnx sv create ....export function detectPnpmMajor(): number | undefined { try { const out = execSync('pnpm --version', { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'], + cwd: os.tmpdir() }); return coerceVersion(out.trim()).major; } catch { return undefined; } }