init command creates a new React Native project with all necessary files and dependencies.
Usage
As of React Native 0.77+, the
init command is deprecated. Use npx @react-native-community/cli init instead.Arguments
| Argument | Description | Required |
|---|---|---|
projectName | Name of your new project | Yes |
Options
| Option | Description | Default |
|---|---|---|
--version <string> | Specific React Native version to use | Latest stable |
--template <string> | Project template to use | Default template |
--npm | Use npm instead of yarn | Auto-detect |
--directory <path> | Custom directory for the project | Current directory |
--title <string> | App display name | Project name |
--skip-install | Skip installing dependencies | false |
--install-pods | Install CocoaPods dependencies (iOS) | true |
--package-name <string> | Android package name | Auto-generated |
Examples
Basic Project Creation
- Latest stable React Native version
- Default TypeScript template
- All dependencies installed
Specific Version
Custom Template
Custom Package Name (Android)
Skip Dependency Installation
package.json before installing.
Use npm Instead of Yarn
Project Structure
After runninginit, your project will have this structure:
After Initialization
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:Environment Variables
Skip Installation
Custom Registry
Troubleshooting
Permission Errors
If you encounter permission errors:Network Timeouts
Increase npm timeout:CocoaPods Installation Fails
Manually install pods:Watchman Issues
Clear Watchman cache:Migration Note
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