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.

CRA not using yarn

See original GitHub issue

Describe the bug

When creating a new app with CRA, CRA is not using yarn, but NPM.

(Write your answer here.)

Did you try recovering your dependencies?

(Write your answer here.)

No because this is related when creating a new CRA app.

Which terms did you search for in User Guide?

I didn’t search in User Guide because formerly this behaviour wasn’t here.

(Write your answer here if relevant.)

Environment

(paste the output of the command here.)


  Environment Info:
  current version of create-react-app: 5.0.0
  running from /home/k.fernando/.config/yarn/global/node_modules/create-react-app

  System:
    OS: Linux 5.10 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found
  • WSL2

Steps to reproduce

(Write your steps here:)

  1. Use the last version of CRA
  2. If you have yarn, then create a new project with CRA
  3. Normally, CRA should use yarn instead of NPM, but in this bug, CRA is using NPM

Expected behavior

(Write what you thought would happen.)

Should use yarn.

Actual behavior

(Write what happened. Please add screenshots!)

Using NPM.

4

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
raixcommented, Dec 19, 2021

@germanamz see https://github.com/facebook/create-react-app/issues/11778#issuecomment-996488034 - from my point of view it is as intended. (yes potentially a breaking change, why it was released as part of v5)

If installing globally on the system I don’t think theres a safe way of detecting the intent when creating a new project to use either yarn or npm - therefor npm will be used as default. (@lukekarrys please correct me if I’m wrong) (global npm install of packages are generally not recommended)

I’ll close the issue - let me know if you if yarn create react-app doesn’t produce a yarn based project or if npx create-react-app doesn’t produce a npm based project.

0reactions
germanamzcommented, Dec 19, 2021

So is there any options we can use? @lukekarrys @raix or is this a bug?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is yarn create react-app command not working
In you /home/flovet-stack/ folder, run ls -a | grep -E 'yarn|package' command. If you see there are a few folders and files such...
Read more >
create-react-app | Yarn - Package Manager
User Guide – How to develop apps bootstrapped with Create React App. ... Inside any created project that has not been ejected, run:...
Read more >
Getting Started - Create React App
When you create a new app, the CLI will use npm or Yarn to install dependencies, depending on which tool you use to...
Read more >
CRA and Yarn Workspace - Medium
It takes a lot of time to set up since CRA does not support well with Yarn Workspace. Therefore, I wanted to set...
Read more >
What Does Create-React-App Actually Do? | by Andrew Mc
Some do not know exactly everything that comes with it, ... Next inside create-react-app (CRA), your command runs through a series of checks....
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