npm init next-app creates a project that uses yarn
See original GitHub issueBug report
Describe the bug
Running npm init next-app creates a new Next.js project that uses Yarn, rather than npm. Given, the fact that I’m using npm to create the project, and the docs offer two options for getting started, one with npm and one with Yarn, this is completely unexpected behavior.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Read getting started docs
- Choose the
npmoption - Run
npm init next-app - Get a project that uses Yarn
Expected behavior
It should create a project that uses npm for package management.
Here ya go, Tim!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:15 (10 by maintainers)
Top Results From Across the Web
npm init next-app creates a project that uses yarn · Issue #10647
Running npm init next-app creates a new Next.js project that uses Yarn, rather than npm. Given, the fact that I'm using npm to...
Read more >yarn init
Interactively creates or updates a package.json file. yarn init. This command walks you through an interactive session to create a package.json file.
Read more >create-next-app - npm
Start using create-next-app in your project by running `npm i ... npx create-next-app@latest # or yarn create next-app # or pnpm create ......
Read more >Getting Started | Next.js
Run npm run dev or yarn dev or pnpm dev to start the development server on http://localhost:3000; Visit http://localhost:3000 to view your application;...
Read more >Nextjs installing react using yarn by default - Stack Overflow
EDIT: npx create-next-app my-app --use-npm. https://github.com/vercel/next.js/issues/10647. OLD ANSWER: Remove yarn.lock and node_modules/
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 Free
Top 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

Anyone who comes here, I don’t think it’s well documented but I found you can install with npm using the
--use-npmflag.e.g.
Hope this helps 🙂
I also agree with @pjaws. Even if we have have yarn installed, create-next-app should have a switch to use npm instead of yarn if its detected.