react-native run-android command terminates by leaving a message in android Device - react-navigation

react-native run-android command terminates by leaving a message in android simulator. The message is as follows:
The development server returned response erre code: 500
What am I doing wrong?

It says you are missing a dependency. Install it with these commands:
npm install #react-navigation/native
cd ios && pod install && cd ..
Add the following in top your index.js
import 'react-native-gesture-handler';
reference: https://reactnavigation.org/docs/getting-started/

Related

Expo client is not installing on Simulator

I have been using this setup for almost half a year now and I upgraded the Expo SDK to 44 (erased all content and settings on the simulator). Ever since, the expo client won't install on the simulator.
Things I have tried:
run expo client:install:ios
uninstall and reinstall expo
uninstall and reinstall watchman
tried different simulators (15.0 that I used so far)
creating a new blank expo project
open the simulator first and then npm start
I even did a complete MacBook reset (factory, needed to wipe anyway) and reinstalled following the expo documentation.
I read something about installing expo without sudo, but then it will throw errors and will simply not install.
New blank expo project infos:
Expo : 44.0.0
expo-cli: 5.0.3
react-native: 0.64.3
Hope someone knows the solution to this, I really want to get back programming.
I had the same problem. Turns out using sudo when installing expo-cli is the issue. Run the following commands to resolve it.
npm uninstall -g expo-cli
npm install -g expo-cli
Then from your Mac's user's directory in a new terminal, run the following:
mkdir apps
cd apps
expo init app-name
Once this finishes, it should work just fine after running npm start.
As #Mercify said, sudo was indeed the problem.
For future reference: if installing expo without sudo throws an error, it is nessecary to change "the owner" of the folder "/usr/.../node_modules" to your user.
This post helps changing the owner.
Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
Expo is now installing on the Simulator.
Thanks to #Mercify.

about 'zsh react-native command not found' AFTER SETTING PATH

Some time ago, I had the command not found error when running expo, so I set path at ~/.bash_profile and so, after running source ~/.bash_profile, now I can call expo without problems.
Today, I tried running react-native link and the following error appeared:
zsh: react-native command not found
What else could I be doing wrong?
Maybe you don't have react native cli installed globally, which is good as it's not needed.
Check in the project directory if react-native is installed
so ./node_modules/react-native/ should exist and has something inside.
If so, you don't need to run react-native directly; try running through npx react-native or npm script.
If not, make sure you have react-native in package.json dependencies section, and run npm install to pull the react-native library folder.

Ionic command not found, but Ionic installed successfully

I am attempting to use Ionic but I am getting the following issues when running the ionic start myApp tabs command:
bash: ionic: command not found
I attempted to use sudo and it shows the issue:
sudo: ionic: command not found
I have tried using the ~/.profile file to avoid permission issues and within that file I Have:
export PATH=$PATH:/Users/[USER HERE]/.npm-packages/bin
I also have tried to uninstall and reinstall node.js and then reinstall Cordova and Ionic but this did not work.
I have also tried:
sudo ln -s /home/[USER HERE]/npm/bin/ionic /usr/bin/ionic
but I get back the error:
ln: /usr/bin/ionic: Operation not permitted
Anyone have any other suggestions as to what I could do to resolve this? I am using a Mac.Im using npm 6.7.0 and node 11.12.0
Have you tried this :
npm install -g ionic

"exp: command not found" How do I add expo cli to path?

I installed the expo cli with
npm i -g exp
then I run
exp
and I get
-bash: exp: command not found
I'm guessing I didn't add exp to path. So how do I do this properly? Nothing I've tried so far works.
This suggested 3 steps solution worked for me:
First check if ~/.npm-global/bin is in your path: echo $PATH. If it isn’t there, you will need to add it to the path.
Open up ~/.bash_profile then add the following line to the bottom: export PATH=$PATH:~/.npm-global/bin
Finally, back in the shell, type: source ~/.bash_profile
Hopefully that will have fixed your problem.
1. Find the path where expo is globally installed by npm:
npm bin -g
2. Add path from Step 1 to paths file:
sudo vi /etc/paths
3. Restart the Terminal
You should try npx expo init <your_app_name> to test.
It worked for me.
I also had a hard time getting expo command to work on Mac. Here are the steps I took to get it working.
npm root -g shows the directory the global modules are installed in:
/usr/local/Cellar/node/11.7.0/lib/node_modules
That directory might be different for you. After confirming expo is in there, edit ~/.bash_profile and add the line:
export PATH=$PATH:/usr/local/Cellar/node/11.7.0/bin
Save & exit, then run source ~/.bash_profile
Now the expo command should function as intended.
try sudo npm install --global expo-cli
this worked for me.
➜ MobileDev git:(campaigns-responsive) ✗ expo whoami
› Not logged in, run expo login to authenticate
➜ MobileDev git:(campaigns-responsive) ✗ expo init App
✔ Choose a template: › blank a minimal app as clean as an empty canvas
✔ Downloaded and extracted project files.
📦 Using npm to install packages.
✔ Installed JavaScript dependencies.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd App
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios
- npm run web
exp was replaced with expo
To install Expo CLI, just run npm install -g expo-cli (or yarn global add expo-cli, whichever you prefer).
Following on this issue, I found I had multiple global folders so I started using a .npm-global folder as shown here: https://docs.npmjs.com/getting-started/fixing-npm-permissions
And now it's all clean and in control.
I had a similar issue.
-bash: expo: command not found
It turns out the command to install expo
npm install -g expo-cli was referencing an older version of node on my machine; when checked using npm root -g.
So I had to uninstall nvm/node, deleted any remnant folders & files of .nvm and shortcuts for nvm in /usr/local. Then reinstalled node and ran npm install -g expo-cli again.
That fixed my issue.
sudo npm install --unsafe-perm -g expo-cli
If you're using git bash on windows, add npm path to your system path variables. Generally located on this location:
C:\Users\<Username>\AppData\Roaming\npm
Then open the bash and command npm start. Hope this will help.
I solved it by putting this in my PATH environment variable / user variable:
C:\Users\{userName}\node_modules\.bin
yarn expo start
Worked for me.
npx create-expo-app project-name

How to solve error Operation not permited, lstat react native on Windows

ERPM: operation no permitted,lstat`
You always have to clean the project before to run the app react-native run-android firstly we need to run this command for windows
cd android && gradlew clean

Resources