Skip to content

Commit

Permalink
Core: Do not add packageManager field to package.json during storyboo…
Browse files Browse the repository at this point in the history
…k dev
  • Loading branch information
valentinpalkovic committed Sep 19, 2024
1 parent 57cdf15 commit 0d238e2
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions code/core/src/common/js-package-manager/JsPackageManagerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,35 @@ export class JsPackageManagerFactory {
}

function hasNPM(cwd?: string) {
const npmVersionCommand = spawnSync('npm', ['--version'], { cwd, shell: true });
const npmVersionCommand = spawnSync('npm', ['--version'], {
cwd,
shell: true,
env: {
COREPACK_ENABLE_STRICT: '0',
},
});
return npmVersionCommand.status === 0;
}

function hasPNPM(cwd?: string) {
const pnpmVersionCommand = spawnSync('pnpm', ['--version'], { cwd, shell: true });
const pnpmVersionCommand = spawnSync('pnpm', ['--version'], {
cwd,
shell: true,
env: {
COREPACK_ENABLE_STRICT: '0',
},
});
return pnpmVersionCommand.status === 0;
}

function getYarnVersion(cwd?: string): 1 | 2 | undefined {
const yarnVersionCommand = spawnSync('yarn', ['--version'], { cwd, shell: true });
const yarnVersionCommand = spawnSync('yarn', ['--version'], {
cwd,
shell: true,
env: {
COREPACK_ENABLE_STRICT: '0',
},
});

if (yarnVersionCommand.status !== 0) {
return undefined;
Expand Down

0 comments on commit 0d238e2

Please sign in to comment.