Skip to content

Commit 14c9769

Browse files
Fix version in Getting Started documentation (#1087)
## Description Running the first command in React Native Windows' [Getting Started][1] documentation npx --yes @react-native-community/cli@latest init <projectName> --version "^0.79.0" fails with > error Cannot read properties of null (reading 'major'). Upstream (react-native-community/cli) docs refer to these versions without quoting them. Dropping the quotes fixes this issue. ### Why Documentation is incorrect, misleading and discouraging. Resolves microsoft/react-native-windows#15081. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/react-native-windows-samples/pull/1087) ## Screenshot <img width="942" height="308" alt="image" src="https://github.com/user-attachments/assets/527cc89d-b3c2-473c-b44b-5d902a394afe" /> [1]: https://microsoft.github.io/react-native-windows/docs/getting-started
1 parent e9602af commit 14c9769

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

docs/getting-started.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ For information around how to set up React Native, see the [React Native Getting
1515

1616
Call the following from the place where you want your project directory to live:
1717

18-
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
18+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version XYZ` are pointing to the correct NPM tags in the command below. -->
1919

20-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
21-
<!-- 2. For stable versions in versioned_docs use "latest" for the CLI and the semantic version, i.e. "^0.73.0" for the RN version -->
20+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `next` for the CLI and `nightly` for the RN version -->
21+
<!-- 2. For stable versions in versioned_docs use `latest` for the CLI and the semantic version, i.e. `^0.73.0` for the RN version -->
2222

2323
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
2424
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
2525

2626
```bat
27-
npx --yes @react-native-community/cli@next init <projectName> --version "nightly"
27+
npx --yes @react-native-community/cli@next init <projectName> --version nightly
2828
```
2929

3030
### Navigate into this newly created directory
@@ -37,10 +37,10 @@ cd <projectName>
3737

3838
### Add React Native Windows to your project's dependencies
3939

40-
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
40+
<!-- Note, make sure `version` is pointing to the correct react-native-windows NPM tag in the command below. -->
4141

42-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
43-
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
42+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `canary` -->
43+
<!-- 2. For other versions in versioned_docs use the version in the format `^0.XY.0` -->
4444

4545
Next you'll want to add `react-native-windows` as a dependency:
4646

website/versioned_docs/version-0.75/getting-started.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ For information around how to set up React Native, see the [React Native Getting
1414

1515
Remember to call `@react-native-community/cli init` from the place you want your project directory to live.
1616

17-
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
17+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version XYZ` are pointing to the correct NPM tags in the command below. -->
1818

19-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
20-
<!-- 2. For the latest stable version in versioned_docs use "latest" for both the CLI and RN version -->
21-
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. "0.73-stable" -->
19+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `next` for the CLI and `nightly` for the RN version -->
20+
<!-- 2. For the latest stable version in versioned_docs use `latest` for both the CLI and RN version -->
21+
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. `0.73-stable` -->
2222

2323
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
2424
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
2525

2626
```bat
27-
npx --yes @react-native-community/cli@latest init <projectName> --version "0.75-stable"
27+
npx --yes @react-native-community/cli@latest init <projectName> --version 0.75-stable
2828
```
2929

3030
### Navigate into this newly created directory
@@ -37,10 +37,10 @@ cd <projectName>
3737

3838
### Add React Native Windows to your project's dependencies
3939

40-
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
40+
<!-- Note, make sure `version` is pointing to the correct react-native-windows NPM tag in the command below. -->
4141

42-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
43-
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
42+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `canary` -->
43+
<!-- 2. For other versions in versioned_docs use the version in the format `^0.XY.0` -->
4444

4545
<!--DOCUSAURUS_CODE_TABS-->
4646

website/versioned_docs/version-0.76/getting-started.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ For information around how to set up React Native, see the [React Native Getting
1616

1717
Remember to call `@react-native-community/cli init` from the place you want your project directory to live.
1818

19-
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
19+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version XYZ` are pointing to the correct NPM tags in the command below. -->
2020

21-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
22-
<!-- 2. For the latest stable version in versioned_docs use "latest" for both the CLI and RN version -->
23-
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. "0.73-stable" -->
21+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `next` for the CLI and `nightly` for the RN version -->
22+
<!-- 2. For the latest stable version in versioned_docs use `latest` for both the CLI and RN version -->
23+
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. `0.73-stable` -->
2424

2525
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
2626
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
2727

2828
```bat
29-
npx --yes @react-native-community/cli@latest init <projectName> --version "0.76-stable"
29+
npx --yes @react-native-community/cli@latest init <projectName> --version 0.76-stable
3030
```
3131

3232
### Navigate into this newly created directory
@@ -39,10 +39,10 @@ cd <projectName>
3939

4040
### Add React Native Windows to your project's dependencies
4141

42-
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
42+
<!-- Note, make sure `version` is pointing to the correct react-native-windows NPM tag in the command below. -->
4343

44-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
45-
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
44+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `canary` -->
45+
<!-- 2. For other versions in versioned_docs use the version in the format `^0.XY.0` -->
4646

4747
<!--DOCUSAURUS_CODE_TABS-->
4848

website/versioned_docs/version-0.77/getting-started.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ For information around how to set up React Native, see the [React Native Getting
1616

1717
Remember to call `@react-native-community/cli init` from the place you want your project directory to live.
1818

19-
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
19+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version XYZ` are pointing to the correct NPM tags in the command below. -->
2020

21-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
22-
<!-- 2. For the latest stable version in versioned_docs use "latest" for both the CLI and RN version -->
23-
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. "0.73-stable" -->
21+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `next` for the CLI and `nightly` for the RN version -->
22+
<!-- 2. For the latest stable version in versioned_docs use `latest` for both the CLI and RN version -->
23+
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. `0.73-stable` -->
2424

2525
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
2626
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
2727

2828
```bat
29-
npx --yes @react-native-community/cli@next init <projectName> --version "^0.77.0"
29+
npx --yes @react-native-community/cli@latest init <projectName> --version ^0.77.0
3030
```
3131

3232
### Navigate into this newly created directory
@@ -39,10 +39,10 @@ cd <projectName>
3939

4040
### Add React Native Windows to your project's dependencies
4141

42-
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
42+
<!-- Note, make sure `version` is pointing to the correct react-native-windows NPM tag in the command below. -->
4343

44-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
45-
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
44+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `canary` -->
45+
<!-- 2. For other versions in versioned_docs use the version in the format `^0.XY.0` -->
4646

4747
<!--DOCUSAURUS_CODE_TABS-->
4848

website/versioned_docs/version-0.78/getting-started.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ For information around how to set up React Native, see the [React Native Getting
1616

1717
Remember to call `@react-native-community/cli init` from the place you want your project directory to live.
1818

19-
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
19+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version XYZ` are pointing to the correct NPM tags in the command below. -->
2020

21-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
22-
<!-- 2. For the latest stable version in versioned_docs use "^0.xx.0" for both the CLI and RN version -->
23-
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. "0.73-stable" -->
21+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `next` for the CLI and `nightly` for the RN version -->
22+
<!-- 2. For the latest stable version in versioned_docs use `^0.xx.0` for both the CLI and RN version --> -->
23+
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. `0.73-stable` -->
2424

2525
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
2626
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
@@ -39,10 +39,10 @@ cd <projectName>
3939

4040
### Add React Native Windows to your project's dependencies
4141

42-
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
42+
<!-- Note, make sure `version` is pointing to the correct react-native-windows NPM tag in the command below. -->
4343

44-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
45-
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
44+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `canary` -->
45+
<!-- 2. For other versions in versioned_docs use the version in the format `^0.XY.0` -->
4646

4747
<!--DOCUSAURUS_CODE_TABS-->
4848

website/versioned_docs/version-0.79/getting-started.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ For information around how to set up React Native, see the [React Native Getting
1818

1919
Call the following from the place where you want your project directory to live:
2020

21-
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
21+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version XYZ` are pointing to the correct NPM tags in the command below. -->
2222

23-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
24-
<!-- 2. For stable versions in versioned_docs use "latest" for the CLI and the semantic version, i.e. "^0.73.0" for the RN version -->
23+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `next` for the CLI and `nightly` for the RN version -->
24+
<!-- 2. For stable versions in versioned_docs use `latest` for the CLI and the semantic version, i.e. `^0.73.0` for the RN version -->
2525

2626
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
2727
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
2828

2929
```bat
30-
npx --yes @react-native-community/cli@latest init <projectName> --version "^0.79.0"
30+
npx --yes @react-native-community/cli@latest init <projectName> --version ^0.79.0
3131
```
3232

3333
### Navigate into this newly created directory
@@ -40,10 +40,10 @@ cd <projectName>
4040

4141
### Add React Native Windows to your project's dependencies
4242

43-
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
43+
<!-- Note, make sure `version` is pointing to the correct react-native-windows NPM tag in the command below. -->
4444

45-
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
46-
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
45+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use `canary` -->
46+
<!-- 2. For other versions in versioned_docs use the version in the format `^0.XY.0` -->
4747

4848
Next you'll want to add `react-native-windows` as a dependency:
4949

0 commit comments

Comments
 (0)