Skip to content

Commit fab6799

Browse files
gaearonPavel Zhytko
authored andcommitted
Use npx in README
1 parent ad738fe commit fab6799

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ If something doesn’t work, please [file an issue](https://github.com/facebooki
1111
## Quick Overview
1212

1313
```sh
14-
npm install -g create-react-app
15-
16-
create-react-app my-app
17-
cd my-app/
14+
npx create-react-app my-app
15+
cd my-app
1816
npm start
1917
```
2018

@@ -32,27 +30,22 @@ Just create a project, and you’re good to go.
3230

3331
## Getting Started
3432

35-
### Installation
36-
37-
Install it once globally:
38-
39-
```sh
40-
npm install -g create-react-app
41-
```
33+
### Prerequisites
4234

4335
**You’ll need to have Node >= 6 on your machine**. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects.
4436

4537
**This tool doesn’t assume a Node backend**. The Node installation is only required for Create React App itself.
4638

4739
### Creating an App
4840

49-
To create a new app, run:
41+
To create a new app, run a single command:
5042

5143
```sh
52-
create-react-app my-app
53-
cd my-app
44+
npx create-react-app my-app
5445
```
5546

47+
([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))
48+
5649
It will create a directory called `my-app` inside the current folder.<br>
5750
Inside that directory, it will generate the initial project structure and install the transitive dependencies:
5851

@@ -77,7 +70,13 @@ my-app
7770
```
7871

7972
No configuration or complicated folder structures, just the files you need to build your app.<br>
80-
Once the installation is done, you can run some commands inside the project folder:
73+
Once the installation is done, you can open your project folder:
74+
75+
```sh
76+
cd my-app
77+
```
78+
79+
Inside the newly created project, you can run some built-in commands:
8180

8281
### `npm start` or `yarn start`
8382

0 commit comments

Comments
 (0)