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.

Generated README containing npm examples is confusing, should be changed to yarn

See original GitHub issue

Upon app creation the output to the console is the following:

Success! Created react-hooks-examples at [...]
Inside that directory, you can run several commands:

  yarn start
    Starts the development server.

  yarn build
    Bundles the app into static files for production.

  yarn test
    Starts the test runner.

  yarn eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

It also creates yarn.lock and no package-lock.json, so clearly uses yarn to install.

On the other hand, the generated README contains the following command examples:

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

Which is confusing, as if npm should be used and is preferred to yarn.

It is not a problem for start or test, but then when a user want to add react-router-dom for instance, chances are she will think the preferred way of doing it is the following:

npm install --save react-router-dom

and not

yarn add react-router-dom

ending up generating the whole new package-lock.json alongside the yarn.lock.

IMHO yarn commands should be used in the generated README to prevent the confusion.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
backtrackbabacommented, Sep 26, 2019

Nice work! @ashr81 🍻

1reaction
zantcommented, Sep 16, 2019

Maybe you can do it in createReactApp.js as they have a useYarn there already, so you can check that and make the regex thing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Are You Still Using Yarn in 2018? - I Am Turns
This is what the readme should tell me! Even if the readme shows both yarn and npm commands, it unnecessarily adds to the...
Read more >
lint-staged - npm
This project contains a script that will run arbitrary shell tasks with ... For example to get a list of changed files between...
Read more >
Why does `package-lock.json` causes a failure in a docker ...
The project must have an existing package-lock.json or npm-shrinkwrap.json. If dependencies in the package lock do not match those in package.
Read more >
thought | Yarn - Package Manager
Every npm-package should have a README-file that contains a short description of what it is and what it does, an explanation of how...
Read more >
Things I wish I had known when I started JavaScript monorepo ...
Root package.json must list all monorepo packages in it's dependencies field. The reason is simple: all packages of the monorepo will be ...
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