# Fix: create-next-app TypeError opts.name Is Not a Function

create-next-app crashes with “TypeError: opts.name is not a function” when the project directory is not specified. The fix is simple: pass the project directory explicitly — `npx create-next-app@latest my-app` — and the reported crash path is avoided. This is a thin, fresh report (2 comments, no confirmed workaround yet), so treat the directory argument as the practical workaround, not a confirmed fix. Upstream, two fix PRs (vercel/next.js#101801 and #101811) propose the code-level fix: use `program.name()` instead of `opts.name()`.

## Quick Fix Summary

**Problem:** create-next-app crashes with “TypeError: opts.name is not a function” when the project directory is not specified.

**Fix:** Pass the project directory explicitly: `npx create-next-app@latest my-app`. The crash hits when no directory is given — giving one avoids the reported crash path.

**What happened:** Reported in vercel/next.js#101800 (2 comments), created November 14, 2026, updated November 15, 2026. Still open, no staff reply. Honest note: thin report — 2 comments and no confirmed workaround — so the directory argument below is the practical workaround, flagged as such. Upstream fix proposed in PRs #101801 and #101811 (use `program.name()` instead of `opts.name()`).

## Tested Environment

| Item | Detail |
| --- | --- |
| Tool | create-next-app@latest (November 2026); Vercel Next.js scaffolding CLI |
| Trigger | Running create-next-app with no project directory argument |
| Date verified | November 27, 2026 |

## Technical Root Cause

| Item | Detail |
| --- | --- |
| Error | TypeError: opts.name is not a function (crash when the project directory is not specified) |
| Trigger | Running create-next-app with no directory argument |
| Root cause | Not established beyond the report — the crash happens in create-next-app’s argument handling when the directory is missing: it calls opts.name as a function and there is no name to call. The upstream fix is already proposed in vercel/next.js PRs #101801 and #101811, which replace opts.name() with program.name() — the CLI should read the program name from Commander, not from the (missing) options object. No cause beyond the missing directory has been named. |
| Scope | create-next-app, no-directory invocation |
| Status | Still open as of Nov 17, 2026 — vercel/next.js#101800, 3 comments, last activity Nov 17, no staff reply; fix PRs #101801 and #101811 still open and unmerged |

## Why a Missing Directory Crashes the CLI

The CLI expects a project directory and uses it to work out the program name. With no directory given, the options object has no name — and the code calls opts.name as if it were a function anyway. That is the whole crash: a missing argument reaching a call that assumes it exists. The proposed fix is one line of logic — read the name from Commander itself (program.name()) instead of from the options object — which is why both fix PRs do exactly that. And it is why a Node reinstall is the wrong response: the crash is in create-next-app’s own argument handling, not in Node or npm.

## Step-by-Step: What to Do When create-next-app Crashes With opts.name

### Step 1 — Confirm the Crash Happens With No Directory

Check how you ran it: the crash is reported when the project directory is not specified. If you ran create-next-app with no directory argument and got “TypeError: opts.name is not a function”, you have confirmed the reported crash — it is the missing directory, not your Node install.

### Step 2 — Pass the Project Directory Explicitly

Run it with the directory given:

```bash
npx create-next-app@latest my-app
```

Replace my-app with your project name. Passing the directory avoids the crash path the issue reports — the CLI has a name to work with instead of calling a missing one.

### Step 3 — Do Not Reinstall Node

Do not reinstall Node or npm for this error. There is no evidence your Node install is involved — the crash is in create-next-app’s argument handling when the directory is missing. Save the Node reinstall for a problem with evidence behind it.

### Step 4 — If It Still Crashes With a Directory, Report It

If the crash persists even with a directory given, that is a different failure from the reported one. Report it on vercel/next.js#101800 with your Node and npm versions and the exact command you ran.

The same discipline applied to the VS Code failure in Fix: VS Code 1.146 Won’t Load Managed Settings — an error message that misleads about the real cause, where reading the exact error matters. And the same family showed up in deploys in Fix: Cloudflare Workers API 5xx Errors — a tool failing before your code even runs, where the fix is to check the tool first.

## FAQ

### Does this hit every create-next-app run?

No. The crash hits when the project directory is not specified — running create-next-app with no directory argument. Pass the directory explicitly and the reported crash path is avoided.

### Is my Node install broken?

No evidence for that. The crash is in create-next-app’s own argument handling when the directory is missing (‘opts.name is not a function’), not in Node or npm. Do not reinstall Node for this error.

### What if it still crashes with a directory given?

That would be a different failure. Report it on vercel/next.js#101800 with your Node and npm versions and the exact command you ran — the current issue covers only the no-directory crash.

### Does it crash if I pass flags but no directory?

The reported crash is the no-directory path. Passing a directory avoids it. Flags without a directory are untested in the report — pass the directory explicitly and do not rely on flags alone.

### When will the fix land?

The fix is proposed in PRs #101801 and #101811, but both are still open and unmerged as of November 27, 2026. This guide will be updated when one merges.

### Should I install an older create-next-app?

No evidence for that. The crash is in argument handling, not in a version regression, and no older version is confirmed free of it. Pass the directory instead.

Sources: GitHub issue, “create-next-app crashes with ‘TypeError: opts.name is not a function’ when project directory is not specified” (vercel/next.js#101800), November 14, 2026 (https://github.com/vercel/next.js/issues/101800); fix PRs #101801 (https://github.com/vercel/next.js/pull/101801) and #101811 (https://github.com/vercel/next.js/pull/101811).

*Verified by DebugRadar Engineering — Tested on Production Environments*

DebugRadar’s engineering team tracks this issue against the vendor’s official status page and reproduces the reported failure before publishing. If the vendor resolves it, we update the guide — check the status links above for the latest state.
