To install React Native on Windows 10, you’ll need to follow these steps:
- Install Node.js:
- Download and install Node.js from its official website. React Native requires Node.js to run the JavaScript code.
- Download and install Node.js from its official website. React Native requires Node.js to run the JavaScript code.
- Install the React Native command line interface (CLI):
- Open your command prompt or terminal.
- Run the command npm install -g react-native-cli.
- Install Java Development Kit (JDK):
- Download and install the JDK from Oracle’s website. React Native requires JDK 8 or newer.
- Download and install the JDK from Oracle’s website. React Native requires JDK 8 or newer.
- Install Android Studio:
- Download and install Android Studio.
- While installing Android Studio, make sure to check the boxes next to:
- Android SDK
- Android SDK Platform
- Performance (Intel ® HAXM)
- Android Virtual Device
- After installation, open Android Studio and install any additional SDK packages as suggested.
- Set up the Android environment:
- Set the environment variables:
- Add the location of your Android SDK to your PATH environment variable.
- Add a new system variable ANDROID_HOME, pointing to your Android SDK directory.
- To edit environment variables on Windows:
- Search for “Environment Variables” in your system settings.
- Edit the PATH variable under “System Variables” and add paths to the SDK’s platform-tools and tools folders.
- Set the environment variables:
- Create a new React Native project:
- In your command prompt or terminal, navigate to the folder where you want to create your project.
- Run ‘react-native init MyNewProject‘.
- Run your React Native application:
- Navigate to your project directory in the command prompt or terminal.
- Run ‘npx react-native run-android‘ to start your application.
Remember, these steps are a general guide. You might need to troubleshoot specific issues or perform additional steps depending on your system configuration.