Skip to content

Commit 3906b90

Browse files
fix(init): use yarn as package manager when calling init with npx (#2216)
1 parent 3945227 commit 3906b90

File tree

1 file changed

+2
-10
lines changed
  • packages/cli/src/commands/init

1 file changed

+2
-10
lines changed

packages/cli/src/commands/init/init.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,8 @@ async function createProject(
331331
function userAgentPackageManager() {
332332
const userAgent = process.env.npm_config_user_agent;
333333

334-
if (userAgent) {
335-
if (userAgent.startsWith('yarn')) {
336-
return 'yarn';
337-
}
338-
if (userAgent.startsWith('npm')) {
339-
return 'npm';
340-
}
341-
if (userAgent.startsWith('bun')) {
342-
return 'bun';
343-
}
334+
if (userAgent && userAgent.startsWith('bun')) {
335+
return 'bun';
344336
}
345337

346338
return null;

0 commit comments

Comments
 (0)