Skip to content

Commit d648c2d

Browse files
authored
fix: not allow install multiple package manager (pnpm#161)
When a project has both npm and pnpm, using pnpm/action-setup will result in an error: `Multiple versions of pnpm specified`. The previous implementation was only meant to avoid the "ERR_PNPM_BAD_PM_VERSION" error, but it did not take into account the situation of multiple different package managers. Signed-off-by: Kevin Cui <bh@bugs.cc>
1 parent a7487c7 commit d648c2d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/install-pnpm/run.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ async function readTarget(opts: {
6464
if (version) {
6565
if (
6666
typeof packageManager === 'string' &&
67+
packageManager.startsWith('pnpm@') &&
6768
packageManager.replace('pnpm@', '') !== version
6869
) {
6970
throw new Error(`Multiple versions of pnpm specified:

0 commit comments

Comments
 (0)