Skip to content

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

Closed
@dubbha

Description

@dubbha

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions