The shell cannot find create-next-app
command not found: create-next-appShort 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.
Fix it fast
1Find out which cause you have
Check that Node.js and npm are available in this shell.
node -v npm -v2Match what you see, then jump to its fix
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-app2Fix
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-app3Verify
The prompts for TypeScript, linter and router appear.
cd my-app && npm run devConfirmed by nextjs.org
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 ls2Fix
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 --versionConfirmed by github.com
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
Web apps
Apollo Server rejects a request as a potential CSRF
HTTP 400 Bad Request from the GraphQL endpoint
Apollo Server's CSRF prevention is on by default.
3 causes, each with a fixWeb apps
Clerk cannot read its publishable key in a Next.js app
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY is undefined
Clerk reads NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY.
3 causes, each with a fixWeb apps
ESLint fails with: Cannot find module 'next/babel'
ESLint stops on the first file with a Babel or parser error instead of listing lint results
next/babel is a Babel preset that ships inside the next package.
3 causes, each with a fixWeb apps
Firebase Auth says the API key is not valid
Firebase: Error (auth/api-key-not-valid.-please-pass-a-valid-api-key.)
The apiKey your app sends is either empty, wrong, or blocked.
4 causes, each with a fixWeb apps
Jest fails with SyntaxError: Unexpected token when testing a Next.js component
Jest failed to parse a file.
Jest only understands plain JavaScript until a transform and a few file mappings tell it more.
3 causes, each with a fixWeb apps
NextAuth sends the user to ?error=AccessDenied after Google sign in
error=AccessDenied
AccessDenied is not a Google or MongoDB error.
2 causes, each with a fix