DEV Community

devesh kumar singh
devesh kumar singh

Posted on

Setup of react native cli 0.81

1. Install Node.js and Watchman

Make sure you have the latest version of Node.js installed.

brew install node
brew install watchman
Enter fullscreen mode Exit fullscreen mode

2. Install React Native CLI globally

npm install -g react-native-cli
Enter fullscreen mode Exit fullscreen mode

Or use npx without global install (recommended to avoid version conflicts):

You don't need to install it globally; you can directly run with:

npx react-native init MyNewProject
Enter fullscreen mode Exit fullscreen mode

This will scaffold the new project.


3. Create a new React Native project

npx react-native init MyNewProject
Enter fullscreen mode Exit fullscreen mode

You can specify a template like this if needed:

npx react-native init MyNewProject --template react-native-template-typescript
Enter fullscreen mode Exit fullscreen mode

4. Navigate into the project directory

cd MyNewProject
Enter fullscreen mode Exit fullscreen mode

5. Install dependencies (if needed)

npm install
Enter fullscreen mode Exit fullscreen mode

or

yarn
Enter fullscreen mode Exit fullscreen mode

6. Run on Android

Make sure you have Android Studio installed with SDK setup and emulator running.

npx react-native run-android
Enter fullscreen mode Exit fullscreen mode

7. Run on iOS (Mac only)

Make sure Xcode is installed.

npx react-native run-ios
Enter fullscreen mode Exit fullscreen mode

This will start the simulator.


8. Linking Native Modules (If Needed)

For libraries that require native code changes:

npx react-native link
Enter fullscreen mode Exit fullscreen mode

Though many libraries now use auto-linking and don't need this step.


9. Debugging and Development

  • Use react-native start to start the Metro bundler manually if it's not auto-running.
npx react-native start
Enter fullscreen mode Exit fullscreen mode
  • You can reload, debug, or use React DevTools.

10. Build APK / IPA (Optional for release)

For Android:

cd android
./gradlew assembleRelease
Enter fullscreen mode Exit fullscreen mode

For iOS:

Open ios/MyNewProject.xcworkspace in Xcode → Archive → Export.


Notes:

  • Use npx for the latest React Native without globally installing.
  • For full native capabilities, CLI is preferable over Expo.
  • Keep SDKs updated regularly.
  • On Windows, iOS build isn't supported unless using cloud services.

Top comments (0)