Registry / devops / react-native-cli

react-native-cli

JSON →
library2.0.1jsnpmunverified

The `react-native-cli` npm package, specifically version 2.0.1 (last updated in 2017), served as the legacy command-line interface for bootstrapping and managing React Native projects. It was designed for global installation, enabling users to create new applications with `react-native init`. However, this package has been superseded; modern React Native development strongly advocates for using `npx react-native` instead. This `npx` approach dynamically fetches and executes the project-local CLI tools (primarily `@react-native-community/cli` or the `react-native` package itself), which ensures compatibility with the specific React Native framework version used in a given project, mitigating issues associated with outdated global CLI installations. The version numbers like v0.85.x seen in recent changelogs refer to the core `react-native` framework package, not this `react-native-cli` wrapper, which has effectively been abandoned.

npm install react-native-cli
INSTALL
IMPORT
SIG · REACT-NATIVE-CLI
R
react-native-cli
devopsjavascriptv2.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

react-native
npx react-native init MyProject
npm install -g react-native-cli; react-native init MyProject
The `react-native-cli` npm package (v2.0.1) provides the global `react-native` command, but modern React Native development strongly recommends using `npx react-native` to ensure using the project-local or latest available CLI tools and avoid global installation issues. This package is not intended for programmatic JavaScript/TypeScript imports.
init
npx react-native init MyProject --template react-native-template-typescript
react-native init MyProject
The `init` subcommand creates a new React Native project. Using `npx` dynamically fetches the latest CLI tools, bypassing the outdated global `react-native-cli` package. No programmatic import for `init` exists.
start
npx react-native start
react-native start
The `start` subcommand launches the Metro bundler. It's typically run from within a React Native project directory, often via `npm run` scripts, ensuring the correct version of the bundler is used. This is a CLI command, not a JavaScript import.

Shows how to create and run React Native projects using the recommended `npx` command, emphasizing the deprecation of the global `react-native-cli` npm package.

// Modern recommended approach using npx to create and manage React Native projects: console.log("// Step 1: Create a new React Native project (recommended)"); console.log("$ npx react-native@latest init AwesomeProject"); console.log("// This command dynamically fetches the necessary CLI tools and template."); console.log("// It does not require a global 'react-native-cli' installation."); console.log(""); console.log("// Step 2: Navigate into your new project directory"); console.log("$ cd AwesomeProject"); console.log(""); console.log("// Step 3: Start the development server (Metro Bundler)"); console.log("$ npx react-native start"); console.log(""); console.log("// Step 4: Run the application on a target platform (e.g., iOS simulator)"); console.log("$ npx react-native run-ios"); console.log(""); console.log("// Legacy approach (not recommended due to package abandonment and potential compatibility issues):"); console.log("// $ npm install -g react-native-cli@2.0.1"); console.log("// $ react-native init DeprecatedProject"); console.log("// This legacy package can cause compatibility issues with newer React Native versions.");
react-native --version
Debug
Known issues
deprecatedThe `react-native-cli` npm package (version 2.0.1, last released in 2017) is effectively abandoned and no longer the recommended way to interact with React Native CLI features. Global installation can lead to significant compatibility issues with newer React Native framework versions.
fix
Always use `npx react-native <command>` (e.g., `npx react-native init MyProject`) to ensure you're using the project-local or latest available CLI tools, instead of relying on a globally installed `react-native-cli`.
affects: >=2.0.1
gotchaThe version numbers like `0.85.x` seen in recent release notes refer to the `react-native` *framework* package, not the `react-native-cli` npm package which remains at `2.0.1` and is outdated.
fix
Understand that `react-native-cli` is a legacy wrapper, and its version does not directly reflect the `react-native` framework version it can interact with. Always check the `react-native` package version within your project.
affects: all
gotchaWhen using local development tools like Sinopia with `react-native-cli`, 'Module version mismatch' errors can occur if Node.js versions change between package installations.
fix
For Sinopia specifically, uninstall and reinstall (`npm uninstall -g sinopia && npm install -g sinopia`). For general `react-native-cli` usage, the best fix is to migrate to `npx react-native`.
affects: >=2.0.1
Errors
Common errors & fixes
Sinopia crashes with "Module version mismatch"
Incompatible Node.js version used for installing global packages like Sinopia.
fix
Uninstall and reinstall `sinopia` globally (`npm uninstall -g sinopia && npm install -g sinopia`). If after upgrading Node.js (e.g., to Node 4), you may also need to reinstall npm (`npm uninstall -g npm && nvm install npm`).
command not found: react-native
The global `react-native-cli` package is not installed, or your PATH environment variable is not correctly configured to find globally installed npm executables.
fix
The recommended solution is to use `npx react-native <command>` directly (e.g., `npx react-native init MyProject`), which does not require a global installation of `react-native-cli`. If you absolutely need the global `react-native` command for legacy reasons, ensure `npm install -g react-native-cli` was run successfully and your shell's PATH includes npm's global bin directory.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
react-nativerequiredThe CLI orchestrates the installation and interaction with the core React Native framework package.
Agent activity
4 hits · last 30 days
node
4
Resources
react-native-cli — npm install react-native-cli · libregistry