You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-13Lines changed: 31 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,21 @@
1
1
# React Native CLI
2
2
3
-
Command line tools to interact with React Native projects.
3
+
Command line tools that ship with [`react-native`](https://github.com/facebook/react-native) in form of the `@react-native-community/cli` package.
4
+
5
+
> It exposes `react-native` binary, so your can call `yarn react-native` or `npx react-native` directly from your project.
_Note: CLI has been extracted from core `react-native` as a part of "[Lean Core](https://github.com/facebook/react-native/issues/23313)" effort. Please read [this blog post](https://blog.callstack.io/the-react-native-cli-has-a-new-home-79b63838f0e6) for more details._
8
10
9
11
## Compatibility
10
12
11
-
This CLI is intended to be used with a certain version of React Native. You'll find the support table with compatible versions below.
13
+
Our release cycle is independent of `react-native`. We follow semver and here is the compatibility table:
12
14
13
-
|CLI | React Native|
14
-
| ------ | ------------ |
15
-
| ^2.0.0 | ^0.60.0 |
16
-
| ^1.0.0| ^0.59.0 |
15
+
|`@react-native-community/cli`|`react-native`|
16
+
| -----------------------------|-------------- |
17
+
| ^2.0.0 | ^0.60.0|
18
+
|[^1.0.0](tree/1.x) | ^0.59.0|
17
19
18
20
## Documentation
19
21
@@ -25,18 +27,22 @@ This CLI is intended to be used with a certain version of React Native. You'll f
25
27
26
28
## About
27
29
28
-
This repository contains tools and helpers for React Native projects in form of a CLI. We want to make a couple of things clear for you first:
30
+
This repository contains tools and helpers for React Native projects in form of a command line tool. There's been quite some confusion around that since the extraction from React Native core. Let's clear them up:
29
31
30
-
- this is a monorepo;
31
-
- there are currently two CLIs: the actual one called [`@react-native-community/cli`](./packages/cli) that does all the job and global [`react-native-cli`](./packages/global-cli) which is used as its proxy and installation helper;
32
+
- There are currently two CLIs:
33
+
-[`@react-native-community/cli`](./packages/cli) – **the one used directly by `react-native`**. That makes it a transitive dependency of your project.
34
+
-[`react-native-cli`](./packages/global-cli) – an optional global convenience package, which is a proxy to [`@react-native-community/cli`](./packages/cli) and global installation helper. **Please consider it legacy, because it's not necessary anymore**.
35
+
- When we say "the CLI" we mean `@react-native-community/cli`.
36
+
- We update the CLI independently of React Native itself. Please see [how to use the latest version](#updating-the-cli).
37
+
- This is a monorepo to keep stuff organized.
32
38
33
-
We know it's confusing, but we're actively working to make this indirection gone.
39
+
We're actively working to make any indirections gone.
34
40
35
41
## Creating a new React Native project
36
42
37
43
There are two ways to start a React Native project.
@@ -46,7 +52,7 @@ This method is preferred if you don't want to install global packages.
46
52
npx react-native init MyApp
47
53
```
48
54
49
-
### Using global CLI
55
+
### Using global CLI (_legacy_)
50
56
51
57
You'll need to install a global module [`react-native-cli`](./packages/global-cli) and follow instructions there.
52
58
@@ -62,7 +68,9 @@ Example running `start` command in terminal:
62
68
63
69
```sh
64
70
yarn react-native start
65
-
# or if you don't use Yarn:
71
+
# or:
72
+
npx react-native start
73
+
# or
66
74
node ./node_modules/.bin/react-native start
67
75
```
68
76
@@ -76,6 +84,16 @@ You can also add npm scripts to call it with whichever package manager you use:
76
84
}
77
85
```
78
86
87
+
## Updating the CLI
88
+
89
+
Because we release independently of `react-native`, it happens that you may be locked on a version without fixes for bugs that affect you. Here's how to get it sorted:
90
+
91
+
1. If you use lock files (`yarn.lock` or `package-lock.json`) - find the `@react-native-community/cli` entry, remove it, run `yarn install` / `npm install` once again.
92
+
2. If you don't use lock files – remove `node_modules` and run `yarn install` / `npm install` again.
93
+
3. Run `yarn list @react-native-community/cli` or `npm list @react-native-community/cli` and verify you're on the latest version.
94
+
95
+
After performing these steps you should be on the latest CLI version. Feel free to do it once in a while, because we release often.
96
+
79
97
## Maintainers
80
98
81
99
- Michał Pierzchała ([**@thymikee**](https://github.com/thymikee)) - [Callstack](https://callstack.com)
0 commit comments