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-cliVerified import paths — ran on the pinned version, not inferred.
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.
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`.
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.
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`.
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`).
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.