question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm init next-app creates a project that uses yarn

See original GitHub issue

Bug 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:

  1. Read getting started docs
  2. Choose the npm option
  3. Run npm init next-app
  4. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

23reactions
mbrooksoncommented, May 4, 2020

Anyone who comes here, I don’t think it’s well documented but I found you can install with npm using the --use-npm flag.

e.g.

npx create-next-app my-app --use-npm

# or 

npm init next-app my-app --use-npm

Hope this helps 🙂

5reactions
nkovaciccommented, Mar 15, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found