node_modules error when running a react-native app - ios

I'm trying to run a react native app, but upon doing react-native run-ios and opening the app in the simulator, I'm getting the following error:
I'm tried running npm install to no avail. How to fix this error?

install this package:
npm i #react-native-community/cli

Related

failure to install cocoapods when initializing a react-native project

I'm currently running macOS Catalina 10.15.6 and XCode 12.4. I'm trying to create a react native ios app and I'm on the command line running "react-native init Focus" where Focus is the name of my app.
When setting up the app, I get the error "(node:11768) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template"
I try to run "cd ./Focus/ios && pod install" which fails, and I have also tried "sudo gem install cocoapods" and "brew install cocoapods" which all fail.
I cannot get past this setup phase of the project.
Fire below code for the setup Project.
npx react-native init ( Your Project Name)
Above code set up your project. And then open your project in IDE which you use for business coding and follow these steps.
Start your react native server by hit the following code
npx react-native start
For the run in iOS do the following steps
cd ios
pod install
cd ..
npx react-native run-ios
Or also you can directly run from Xcode after the third step. You do not need to hit the 4 setup

How to make sure expo knows SDK is installed in my laptop

I am currently making a react native app and have installed expo but I am getting the error below in the image. I have SDK(29) in my device but how do I make sure that expo knows it.
You don't seem to have made Expo a project.
Did you ran react-native init ??? If yes, it is not an Expo project. it is only react-native project
To make sure that Expo is installed properly: Verify that the
installation was successful by running expo whoami.
If you want an Expo project, run the following command.
expo init AwesomeProject
cd AwesomeProject
npm start # you can also use: expo start
The project you received from Git seems to be a React-native project.
You can try this command.
cd gitproject
npm install
cd ios
pod install
cd ..
npx react-native run-ios or run-android
In the terminal run
expo --version
if installed it will return the version like
5.2.0
else you will get
'expo' is not recognized as an internal or external command,
operable program or batch file.

Failed IOS Build React Native

I downloaded a branch from my github project and when I run the simulator, it runs but the app displays this error.
I have already tried removing the build folder and re running it and I have done npm install when the error displays and running "react-native run-ios". I don't know what to do.
Open additional terminal in the same folder. Run this command.
react-native start --reset-cache
Once the package manager is ready, go back to your first terminal and run your app again.
react-native run-ios

UnhandledPromiseRejectionWarning: xcodebuild was not found

Recently I created an app in ionic and I wanted to test it in ios. So I run the command ionic cordova emulate ios . But, It is giving me following error.
(node:4200) UnhandledPromiseRejectionWarning: xcodebuild was not found. Please install version 7.0.0 or greater from App Store
I also run following commands but it still shows same error.
npm install -g ios-sim
and
npm install -g ios-deploy
Please guide me what to do.
NOTE: I am using Ubuntu 16.04
You are getting an error because you are running this command on Linux you need macOS to run this command. Hope this will help you :)

React native runnig error on ios device

I am trying to run react native code to iphone, however it shows the following message.
The following code runs on Android normally, and on expo fine too, but it does not run on physical device.
Please help me.
E:\reactnative\cd webview
E:\reactnative\webview>react-native run-ios
Scanning folders for symlinks in E:\reactnative\webview\node_modules (38ms)
Found Xcode project webview.xcodeproj
spawnSync xcrun ENOENT
E:\reactnative\webview>
If you are using react-native-cli version 0.1.7 then you could either
Rollback to 0.1.7 (do not use '--verbose' argument)
npm install -g react-native-cli#0.1.7
or try it with the latest which might be fixed
npm uninstall -g react-native-cli
npm install -g react-native-cli
There was a regression in 0.1.8, reported here: https://github.com/facebook/react-native/issues/5169

Resources