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:
- Open the terminal and navigate to your React Native project folder.
- Run the command
npm install -g react-native-cli
to globally install the React Native CLI. - Use the command
react-native start
to start the React Native packager. - In a separate terminal window, navigate to your project folder and run
react-native run-android
orreact-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.