Skip to main content
The init command creates a new React Native project with all necessary files and dependencies.

Usage

npx react-native init <projectName> [options]
As of React Native 0.77+, the init command is deprecated. Use npx @react-native-community/cli init instead.

Arguments

ArgumentDescriptionRequired
projectNameName of your new projectYes

Options

OptionDescriptionDefault
--version <string>Specific React Native version to useLatest stable
--template <string>Project template to useDefault template
--npmUse npm instead of yarnAuto-detect
--directory <path>Custom directory for the projectCurrent directory
--title <string>App display nameProject name
--skip-installSkip installing dependenciesfalse
--install-podsInstall CocoaPods dependencies (iOS)true
--package-name <string>Android package nameAuto-generated

Examples

Basic Project Creation

npx react-native init MyApp
This creates a new project named “MyApp” with:
  • Latest stable React Native version
  • Default TypeScript template
  • All dependencies installed

Specific Version

npx react-native init MyApp --version 0.75.0

Custom Template

npx react-native init MyApp --template react-native-template-typescript

Custom Package Name (Android)

npx react-native init MyApp --package-name com.mycompany.myapp

Skip Dependency Installation

npx react-native init MyApp --skip-install
Useful when you want to modify package.json before installing.

Use npm Instead of Yarn

npx react-native init MyApp --npm

Project Structure

After running init, your project will have this structure:
MyApp/
├── android/              # Android native project
│   ├── app/
│   ├── gradle/
│   └── build.gradle
├── ios/                  # iOS native project
│   ├── MyApp/
│   ├── MyApp.xcodeproj/
│   └── Podfile
├── node_modules/         # JavaScript dependencies
├── .bundle/             # Ruby bundler config (for CocoaPods)
├── App.tsx              # Main app component
├── index.js             # Application entry point
├── app.json             # App metadata
├── babel.config.js      # Babel configuration
├── metro.config.js      # Metro bundler config
├── package.json         # Project dependencies
├── tsconfig.json        # TypeScript configuration
└── .watchmanconfig      # Watchman configuration

After Initialization

1

Navigate to project

cd MyApp
2

Install iOS dependencies (macOS only)

cd ios && pod install && cd ..
Skip this if you used --install-pods (default).
3

Start Metro

npx react-native start
4

Run your app

# iOS
npx react-native run-ios

# Android
npx react-native run-android

Templates

Official Templates

  • Default - TypeScript template with best practices
  • react-native-template-typescript - TypeScript template

Community Templates

You can use any npm package as a template:
npx react-native init MyApp --template react-native-template-custom

Environment Variables

Skip Installation

SKIP_INSTALL=true npx react-native init MyApp

Custom Registry

npm_config_registry=https://registry.npmjs.org/ npx react-native init MyApp

Troubleshooting

Permission Errors

If you encounter permission errors:
sudo chown -R $USER /usr/local/lib/node_modules

Network Timeouts

Increase npm timeout:
npm config set fetch-timeout 600000
npx react-native init MyApp

CocoaPods Installation Fails

Manually install pods:
cd MyApp/ios
pod install
cd ..

Watchman Issues

Clear Watchman cache:
watchman watch-del-all

Migration Note

Starting with React Native 0.77, npx react-native init is deprecated.Use the Community CLI instead:
npx @react-native-community/cli init MyApp
Or use alternative frameworks:

Next Steps

Quick Start

Complete tutorial for your first app

Start Command

Learn how to start the development server

Run iOS

Build and run on iOS devices

Run Android

Build and run on Android devices

Build docs developers (and LLMs) love