react-native: command not found
After adding right path to the PATH variable issue is resolved.
Below are the steps to find the right path.
1. Enter: npm install -g react-native-cli
output: /usr/local/Cellar/node/6.1.0/libexec/npm/bin/react-native ->/usr/local/Cellar/node/6.1.0/libexec/npm/lib/node_modules/react-native-cli/index.js/usr/local/Cellar/node/6.1.0/libexec/npm/lib
└── react-native-cli@0.2.0
from above output you can clearly see the path: /usr/local/Cellar/node/6.1.0/libexec/npm/bin/react-native
export PATH="/usr/local/Cellar/node/6.1.0/libexec/npm/bin:$PATH"
react-native init appName
cd appName
react-native run-ios
if you getting xcrun: error: unable to find utility "simctl" at this stage you can reslove using below steps
XCode -> Preferences -> Locations -> Command Line Tools -> Choose Xcode 7.2.1
You can find original solution from xcrun unable to find simctl
Thanks to @fbozo
That's It!!!
-bash: react-native command not found
command not found
means exactly that - the command you tried to execute (react-native
) isn't found in any of the directories listed in your PATH
variable.
Figure out where react-native
is installed and either call it with a full path to the executable or add the directory to your PATH.
Based on this from your question:
5 echo $PATH:
/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/(myname)/Library/Android/sdk/emulator:/Users/(myname)/Library/Android/sdk/tools:/Users/(myname)/Library/Android/sdk/tools/bin:/Users/(myname)/Library/Android/sdk/platform-tools:/Users/(myname)/Library/Android/sdk/tools/bin
My best guess is that during installation you were following instructions that said to put (myname)
somewhere and you literally entered the string (myname)
instead of entering your actual login name.
Related Topics
Adding Button Action in Custom Notification
Android Failed to Start Emulator:Cannot Run Program
Customize Android Facebook Login Button
Getexternalstoragepublicdirectory Deprecated in Android Q
How to Make an App's Background Image Repeat
Transfer Data Between iOS and Android via Bluetooth
Listview Getchildat Returning Null for Visible Children
Coloring Buttons in Android with Material Design and Appcompat
How to Get Device Id for Admob
Deleting Android Sms Programmatically
How to Get String from Different Locales in Android
How to Get Higher Precision of "Cpu%" Than That from Top Command
Detect a New Android Notification
Filtering Listview with Custom (Object) Adapter
Build and Install Unsigned APK on Device Without the Development Server
Android Webview Not Loading an Https Url