Skip to content

Commit 886f621

Browse files
vinnymactaskylizard
authored andcommitted
fix: local execute for yarn v1 and 2+ compatibility (npmx-dev#544)
1 parent bff8837 commit 886f621

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

app/utils/install-command.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const packageManagers = [
2525
id: 'yarn',
2626
label: 'yarn',
2727
action: 'add',
28-
executeLocal: 'yarn',
28+
// For both yarn v1 and v2+ support
29+
// local exec defers to npx instead
30+
executeLocal: 'npx',
2931
executeRemote: 'yarn dlx',
3032
create: 'yarn create',
3133
icon: 'i-simple-icons:yarn',

test/unit/app/utils/install-command.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ describe('install command generation', () => {
292292
it.each([
293293
['npm', ['npx', 'eslint']],
294294
['pnpm', ['pnpm', 'exec', 'eslint']],
295-
['yarn', ['yarn', 'eslint']],
295+
['yarn', ['npx', 'eslint']],
296296
['bun', ['bunx', 'eslint']],
297297
['deno', ['deno', 'run', 'npm:eslint']],
298298
['vlt', ['vlt', 'x', 'eslint']],

test/unit/app/utils/run-command.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('executable detection and run commands', () => {
8181
it.each([
8282
['npm', ['npx', 'eslint']],
8383
['pnpm', ['pnpm', 'exec', 'eslint']],
84-
['yarn', ['yarn', 'eslint']],
84+
['yarn', ['npx', 'eslint']],
8585
['bun', ['bunx', 'eslint']],
8686
['deno', ['deno', 'run', 'npm:eslint']],
8787
['vlt', ['vlt', 'x', 'eslint']],

0 commit comments

Comments
 (0)