Skip to content

fix Docs: add patch to CLI --version - #5220

Merged
Simek merged 1 commit into
react:mainfrom
angelabenavente:docs/fix-cli-init-version-5173
Sep 4, 2026
Merged

fix Docs: add patch to CLI --version#5220
Simek merged 1 commit into
react:mainfrom
angelabenavente:docs/fix-cli-init-version-5173

Conversation

@angelabenavente

Copy link
Copy Markdown
Contributor

Fixes #5173

The CLI looks up npm templates by exact version. Docs used the Docusaurus label (0.86 / 0.87), so init --version 0.86 failed.

getCurrentVersion() now returns a patch (0.87.0).

Appending .0 in the snippet made Prism (bash) treat 0.87 as a number and .0 as another token, so the version was two colors (screenshot of Highlight). The value is quoted (--version "0.87.0") so it highlights as one string. The CLI accepts that the same way.

Screenshots

CLI (before ), command from the docs:

Captura de pantalla 2026-08-31 a las 23 21 55

CLI (after), --version "0.87.0"

Captura de pantalla 2026-08-31 a las 23 24 59

Docs (before), https://reactnative.dev/docs/turbo-native-modules-introduction

Captura de pantalla 2026-08-31 a las 23 19 38

Highlight (without quotes), --version 0.87.0

Captura de pantalla 2026-08-31 a las 23 23 42

Docs (after)

Captura de pantalla 2026-08-31 a las 23 20 23

Affected pages

https://reactnative.dev/docs/turbo-native-modules-introduction
https://reactnative.dev/docs/the-new-architecture/using-codegen
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

Issue

#5173

@Simek Simek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @angelabenavente, thanks for fixing this issue! 👍

I have tested the updated command on macOS and Windows, also getCurrentVersion function is currently used only to inject version in template commands, so it should be safe to modify code at the helper level.

@Simek
Simek merged commit 4ad7af6 into react:main Sep 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to install TurboModuleExample using the shell command line

2 participants