node closes once you open app react-native

To address the issue of Node.js closing when opening a React Native app, it's important to understand that React Native runs its own Node.js instance, which can conflict with a globally installed Node.js. To resolve this, you can use the following steps:

  1. Open the terminal and navigate to your React Native project folder.
  2. Run the command npm install -g react-native-cli to globally install the React Native CLI.
  3. Use the command react-native start to start the React Native packager.
  4. In a separate terminal window, navigate to your project folder and run react-native run-android or react-native run-ios to launch your app.

By following these steps, you'll ensure that the React Native app uses its own Node.js instance, preventing conflicts with any globally installed Node.js version.