Next.js - 12.1.1 -> not allowing npx create-next-app
See original GitHub issueVerify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
‘next’ is not recognized as an internal or external command, operable program or batch file.
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
after updating the create-next-app
by npm install -g create-next-app
after that when I am running the below command to start a Nextjs App, I am getting below error.
C:\Users\Dhaval Vira\Desktop\Coursera Learning\Next_Prisma>npx create-next-app demotwo
Creating a new Next.js app in C:\Users\Dhaval Vira\Desktop\Coursera Learning\Next_Prisma\demotwo.
Using yarn.
Installing dependencies:
- react
- react-dom
- next
'yarn' is not recognized as an internal or external command,
operable program or batch file.
node:events:504
throw er; // Unhandled 'error' event
^
Error: spawn yarn ENOENT
at notFoundError (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:3828)
at verifyENOENT (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4207)
at ChildProcess.e.emit (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4062)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.e.emit (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4103)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn yarn',
path: 'yarn',
spawnargs: [
'add',
'--exact',
'--cwd',
'C:\\Users\\Dhaval Vira\\Desktop\\Coursera Learning\\Next_Prisma\\demotwo',
'react',
'react-dom',
'next'
]
}
Expected Behavior
after updating create-next-app
to 12.1.1, npx create-next-app appname
is not creating the Next app
To Reproduce
I tried npx create-next-app@latest appname
but it’s throwing the same error.
even I tried to uninstall the create-next-app
& reinstalled it but it’s throwing the same error.
and I install yarn
globally then npx create-next-app appname
run command properly without any error
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Upgrade Guide - Next.js
Upgrade Guide. Upgrading from 12 to 13. To update to Next.js version 13, run the following command using your preferred package manager:
Read more >create-next-app - npm
The easiest way to get started with Next.js is by using create-next-app . This CLI tool enables you to quickly start building a...
Read more >next.js - "command not found: create-next-app" how do I ...
First install create-next-app globally by doing npm i -g create-next-app. After you can use create-next-app CLI to create next app.
Read more >No Next.js version could be detected in your project. Make sure
To create a project, run: $ npx create-next-app@latest # or $ yarn create next-app ... What I find has been letting me get...
Read more >Next.js Create Next App - GeeksforGeeks
Next.js uses React with some extra functionalities like allowing ... type npx/npm create next-app which will start installing a new Next Js ......
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
“npx create-next-app@latest --use-npm”
@ijjk -> Thank you, sir, the problem is solved!!! and I tried with
npx create-next-app appname
it’s working perfectly fine.Thanks a lot!