Skip to content

Commit 5144544

Browse files
Update init.md (#2700)
* Update init.md init commands have been changed to react-native-community/cli@latest from react-native@latest. And some more similar changes. ** Check for yarn related commands. * Update init.md
1 parent 12d1918 commit 5144544

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/init.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
There are couple of ways to initialize new React Native projects.
44

55
```sh
6-
npx react-native@latest init ProjectName
6+
npx react-native-community/cli@latest init ProjectName
77
```
88

99
> Note: If you have both `yarn` and `npm` installed on your machine, React Native CLI will always try to use `npm`. You can force usage of `yarn` by adding `--pm yarn` flag to the command.
@@ -20,10 +20,10 @@ yarn init && yarn add react-native && yarn react-native init ProjectName
2020

2121
```sh
2222
# This will use the latest init command but will install react-native@VERSION and use its template
23-
npx react-native@latest init ProjectName --version ${VERSION}
23+
npx react-native-community/cli@latest init ProjectName --version ${VERSION}
2424

25-
# This will use init command from react-native@VERSION
26-
npx react-native@${VERSION} init ProjectName
25+
# This will use init command from react-native@VERSION through react-native-community/cli@${VERSION} (e.g. X.XX.X) automatically
26+
npx react-native-community/cli@${VERSION} init ProjectName
2727
```
2828

2929
## Initializing project with custom template
@@ -43,16 +43,16 @@ For all available options, please check [Yarn documentation](https://classic.yar
4343

4444
```sh
4545
# This will initialize new project using template from `react-native-template-typescript` package
46-
npx react-native@latest init ProjectName --template ${TEMPLATE_NAME}
46+
npx react-native-community/cli@latest init ProjectName --template ${TEMPLATE_NAME}
4747

4848
# This will initialize new project using init command from react-native@VERSION but will use a custom template
49-
npx react-native@${VERSION} init ProjectName --template ${TEMPLATE_NAME}
49+
npx react-native-community/cli@${VERSION} init ProjectName --template ${TEMPLATE_NAME}
5050
```
5151

5252
You can force usage of `yarn` if you have both `yarn` and `npm` installed on your machine:
5353

5454
```sh
55-
npx react-native@latest init ProjectName --pm yarn
55+
npx react-native-community/cli@latest init ProjectName --pm yarn
5656
```
5757

5858
## Creating custom template

0 commit comments

Comments
 (0)