Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native not found + mac os

I am trying to run basic react-native app in my macOS. I installed node through brew .

My node version: v6.12.0
npm version :5.5.1

Then i installed reatc-native-cli using npm. Now when i try to create a project using react-native init it says react-native command not found.

I tried all solutions but no hope. as i am new bee to this react-native guide me solve this. Thanks in advance.

I tried all post including

react-native: command not found

like image 654
Subburaj Avatar asked Nov 29 '17 10:11

Subburaj


People also ask

How do I install react native on my Macbook?

Running your React Native applicationInstall the Expo Go app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.


2 Answers

You should install React-Native CLI first before using "react-native init".

npm install -g react-native-cli

For more information of getting started React-Native in manual, please follow this Document

https://facebook.github.io/react-native/docs/getting-started.html

And select tab Building Projects with Native Code for manual create project without Expo

like image 121
Seyha Avatar answered Oct 22 '22 03:10

Seyha


Steps to install React Native CLI in Mac OS:

  1. Run npm install -g react-native-cli

or sudo npm install -g react-native-cli 2. Once successful, get the installed path from the output:

/Users/jeemok/.npm-packages/bin/react-native -> /Users/jeemok/.npm-packages/lib/node_modules/react-native-cli/index.js
+ [email protected]
added 78 packages from 28 contributors in 12.39s

In my case, my path is /Users/jeemok/.npm-packages/bin/react-native 3. Run export PATH="/Users/jeemok/.npm-packages/bin:$PATH" 4. Now you should be able to use the command react-native


Example to init a project

react-native init TodoApp
cd TodoApp
react-native run-ios
like image 44
Jee Mok Avatar answered Oct 22 '22 02:10

Jee Mok