Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

The shell cannot find create-next-app

Errorcommand not found: create-next-app

Short answer

create-next-app is not meant to be installed as a shell command. Next.js documents running it through your package manager: npx create-next-app@latest, or pnpm, yarn or bun create next-app. If npx itself is missing, Node.js is not active in this shell, often because a version manager was not loaded.

  • Applies to Next.js 15, Next.js 16, Node.js 22, npm 10
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check that Node.js and npm are available in this shell.

    node -v
    npm -v
  2. 2Match what you see, then jump to its fix

    1. 1node -v works, but create-next-app is not foundThe tool was typed as a bare commandFix
    2. 2node: command not found or npx: command not found in a new terminalNode.js is not active in this shellFix

What does the error look like?

  • command not found: create-next-app

Cause 1 of 2

The tool was typed as a bare command

1Check

The Next.js docs never call create-next-app directly; they run it through the package manager.

which create-next-app

2Fix

Run it with your package manager.

npx create-next-app@latest my-app
# or: pnpm create next-app my-app
# or: yarn create next-app my-app
# or: bun create next-app my-app

3Verify

The prompts for TypeScript, linter and router appear.

cd my-app && npm run dev

Confirmed by nextjs.org

Did this fix it?

Cause 2 of 2

Node.js is not active in this shell

1Check

With nvm, new shells start with the default version. If no default is set, a fresh terminal may have no Node.js.

nvm ls

2Fix

Install a current LTS version and make it the default.

nvm install --lts
nvm alias default 'lts/*'

3Verify

Open a new terminal and check the versions.

node -v
npx create-next-app@latest --version

Confirmed by github.com

Did this fix it?

How do I stop it coming back?

  • Always use the package-manager form from the Next.js installation page.
  • Set a default Node.js version in nvm so every new terminal has one.
  • Keep a .nvmrc in the project so nvm use picks the right version.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.