React-Native: Command Not Found

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



Leave a reply



Submit