Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
Does npx use yarn?

Today I created a reactjs starting template with CRA using:

npx create-react-app my-app --template redux

This created two files in my project: package.json and yarn.lock.

I am confused about why it worked after I cd in the project and ran yarn start even though I didn't initiate the project with yarn create react-app my-app.

I have two questions:

  • Why it generated yarn.lock?
  • What is the difference between
    • npx create-react-app my-app --template redux and
    • yarn create react-app my-app --template redux considering that they have the same effect.
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

npx create-react-app executes create-react-app binary, and create-react-app uses yarn to create your project (if yarn is installed). that's why you can see yarn.lock and also why yarn-start works.

Difference between npx create-react-app and yarn create react-app

They both executes create-react-app binary. create-react-app is the one who decides whether it wants to create the project with yarn or not. to use npm in create-react-app, use --use-npm flag (no matter you execute create-react-app with npx or yarn or directly, you should set it if you want it to use npm .):

create-react-app my-project --use-npm
over 4 years ago · Santiago Trujillo Report

0

create-react-app uses yarn for the setup if it's installed.

So, if yarn is already installed in your system, then npx create-react-app my-app --template redux and yarn create react-app my-app --template redux would give you the same end-result.

And it is already installed in your system, that's why it has generated yarn.lock and not package.lock.

yarn.lock is generated to keep the exact version of the installed packages.
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!