Unverified Commit 4d4dc4b5 authored by FluxCapacitor's avatar FluxCapacitor Committed by GitHub

docs: fix Bun install command (#65016)

### What?

Corrects the Bun install command (again) on [this
page](https://nextjs.org/docs/app/api-reference/create-next-app#interactive)
of the docs.

### Why?

The Bun instructions were originally created in
7e165384 with a correct command to
create a new Next.js project with Bun: `bunx create-next-app`.

Then, it was changed to `bunx create next-app` in
2ab4a443, which isn't correct because
`bunx` acts like `npx` and tries to run a nonexistent package called
`create`, specifying `next-app` as its argument.

This change was reverted in a42efae4 two
weeks ago, and a PR from today (#64972) reverts that correction.

Both `bunx create-next-app` and `bun create next-app` work on my machine
as of Bun 1.0. `bunx create-next-app` is analogous to `npx
create-next-app`, and `bun create next-app` is the same as `npm create
next-app`.

| Command | Correct? | Similar NPM command | Note |
|---|---|---|---|
| `bun create next-app` | ✅ | `npm create next-app` |
My proposed change |
| `bunx create-next-app` | ✅ | `npx create-next-app` |
|
| `bunx create next-app` | ❌ | `npx create next-app` (incorrect) |
Currently listed in the Next.js docs |
| `bun create-next-app` | ❌ | `npm create-next-app` (incorrect) | |

I think this confusion is caused by having two valid ways to run
`create-next-app` with two very similar syntaxes. **It could be
beneficial to include a note explaining the two correct syntaxes** to
avoid future confusion, but for now, I have just changed `bunx` -> `bun`
to keep the command similar to `yarn` and `pnpm`.
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent 45e6b3e0
...@@ -26,7 +26,7 @@ pnpm create next-app ...@@ -26,7 +26,7 @@ pnpm create next-app
``` ```
```bash filename="Terminal" ```bash filename="Terminal"
bunx create next-app bun create next-app
``` ```
You will then be asked the following prompts: You will then be asked the following prompts:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment