Skip to content

Commit 8ec61f3

Browse files
committed
fix(dedupeDependencies): use install for yarn v1
1 parent 2d6cfbf commit 8ec61f3

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/api.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,19 @@ export async function dedupeDependencies(
257257
return;
258258
}
259259
if (isSupported) {
260-
await executeCommand(resolvedOptions.packageManager.command, ["dedupe"], {
261-
cwd: resolvedOptions.cwd,
262-
silent: resolvedOptions.silent,
263-
});
260+
// https://classic.yarnpkg.com/en/docs/cli/dedupe
261+
const isyarnv1 =
262+
resolvedOptions.packageManager.name === "yarn" &&
263+
resolvedOptions.packageManager.majorVersion === "1";
264+
265+
await executeCommand(
266+
resolvedOptions.packageManager.command,
267+
[isyarnv1 ? "install" : "dedupe"],
268+
{
269+
cwd: resolvedOptions.cwd,
270+
silent: resolvedOptions.silent,
271+
},
272+
);
264273
return;
265274
}
266275
throw new Error(

0 commit comments

Comments
 (0)