{"id":17891,"library":"react-native-cli","title":"React Native CLI Tools","description":"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.","status":"abandoned","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/facebook/react-native","tags":["javascript"],"install":[{"cmd":"npm install react-native-cli","lang":"bash","label":"npm"},{"cmd":"yarn add react-native-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-native-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The CLI orchestrates the installation and interaction with the core React Native framework package.","package":"react-native","optional":false}],"imports":[{"note":"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.","wrong":"npm install -g react-native-cli; react-native init MyProject","symbol":"react-native","correct":"npx react-native init MyProject"},{"note":"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.","wrong":"react-native init MyProject","symbol":"init","correct":"npx react-native init MyProject --template react-native-template-typescript"},{"note":"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.","wrong":"react-native start","symbol":"start","correct":"npx react-native start"}],"quickstart":{"code":"// Modern recommended approach using npx to create and manage React Native projects:\nconsole.log(\"// Step 1: Create a new React Native project (recommended)\");\nconsole.log(\"$ npx react-native@latest init AwesomeProject\");\nconsole.log(\"// This command dynamically fetches the necessary CLI tools and template.\");\nconsole.log(\"// It does not require a global 'react-native-cli' installation.\");\nconsole.log(\"\");\nconsole.log(\"// Step 2: Navigate into your new project directory\");\nconsole.log(\"$ cd AwesomeProject\");\nconsole.log(\"\");\nconsole.log(\"// Step 3: Start the development server (Metro Bundler)\");\nconsole.log(\"$ npx react-native start\");\nconsole.log(\"\");\nconsole.log(\"// Step 4: Run the application on a target platform (e.g., iOS simulator)\");\nconsole.log(\"$ npx react-native run-ios\");\nconsole.log(\"\");\nconsole.log(\"// Legacy approach (not recommended due to package abandonment and potential compatibility issues):\");\nconsole.log(\"// $ npm install -g react-native-cli@2.0.1\");\nconsole.log(\"// $ react-native init DeprecatedProject\");\nconsole.log(\"// This legacy package can cause compatibility issues with newer React Native versions.\");","lang":"typescript","description":"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."},"warnings":[{"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`.","message":"The `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.","severity":"deprecated","affected_versions":">=2.0.1"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"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`.","message":"When using local development tools like Sinopia with `react-native-cli`, 'Module version mismatch' errors can occur if Node.js versions change between package installations.","severity":"gotcha","affected_versions":">=2.0.1"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"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`).","cause":"Incompatible Node.js version used for installing global packages like Sinopia.","error":"Sinopia crashes with \"Module version mismatch\""},{"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.","cause":"The global `react-native-cli` package is not installed, or your PATH environment variable is not correctly configured to find globally installed npm executables.","error":"command not found: react-native"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}