`npx create-next-app@latest` not working
See original GitHub issueVerify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
I did not check next@canary because I don’t think believe that create-next-app would carry over
Because I’m not even able to make a project with create-next-app, here’s what’s happening:
When I run the npx create-next-app@latest
command in the terminal, I get this error:
~ on ☁️
❯ npx create-next-app
Need to install the following packages:
create-next-app
Ok to proceed? (y) y
✔ What is your project named? … test2
Creating a new Next.js app in /home/harry/test2.
Using yarn.
Installing dependencies:
- react
- react-dom
- next
node:events:498
throw er; // Unhandled 'error' event
^
Error: spawn yarn ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn yarn',
path: 'yarn',
spawnargs: [
'add',
'--exact',
'--cwd',
'/home/harry/test2',
'react',
'react-dom',
'next'
]
}
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
create-next-app is not working. The command only produces a directory and a package.json file. That’s it.
Expected Behavior
I want create-next-app to build me a next.js project
To Reproduce
run create-next-app@latest
in your terminal
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:12 (2 by maintainers)
Top Results From Across the Web
create-next-app: command not found error [Solved] | bobbyhadz
Use `npx` to solve the error create-next-app: command not found, e.g. `npx create-next-app@latest` or install the package globally by running `npm install ...
Read more >next.js - "command not found: create-next-app" how do I ...
Create a new folder and name it as you like,then open your terminal & go into the project folder and run the step...
Read more >Create Next App | Next.js
Interactive Experience: Running npx create-next-app@latest (with no arguments) launches an interactive experience that guides you through setting up a project.
Read more >How to install Next.js globally help of create-next-app? - Medium
npx create -next-app@latest --typescript ... The second method is not a very common way to install next.js. in this method, you install nextjs,...
Read more >Home | Create React App – Set up a Next.js app by running ...
Set up a Next.js app by running one command.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like this will be fixed in #35608. It hasn’t been made part of an official release yet, only merged into
canary
. I was able to bypass the error using the--use-npm
flag.TIL: Next.js now uses Yarn by default: https://github.com/vercel/next.js/pull/34947#discussion_r820032044
I am experiencing the same issue,
I have never installed yarn yet it still is trying to install next template project via yarn instead of npm.