Skip to content

Commit

Permalink
Fix create-next-app failing without yarn installed (#35608)
Browse files Browse the repository at this point in the history
This fixes our package manager detection which was changed slightly in vercel/next.js#34947 for `pnpm` support to ensure the default case still attempts detecting the available package manager if no preference is specified in the command args. This also adds a test case to ensure the install succeeds when we fail to detect a valid `yarn` binary and no preference is set via the `npm_config_user_agent` env variable. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: vercel/next.js#35607
Fixes: vercel/next.js#35599
  • Loading branch information
ijjk committed Mar 26, 2022
1 parent 33a3cbc commit d8b70e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function run(): Promise<void> {
? 'npm'
: !!program.usePnpm
? 'pnpm'
: 'yarn'
: getPkgManager()

const example = typeof program.example === 'string' && program.example.trim()
try {
Expand Down

0 comments on commit d8b70e6

Please sign in to comment.