React Native: Command `run-ios` unrecognized
Solution 1:
Just update the version of react native in your project with the following command:
$> npm install --save react-native@latest
Solution 2:
What caused this for me was running npm install --save [package]
when actually the system has previously been using yarn
instead of npm
.
To solve this I just deleted the node_modules
folder and ran: yarn install
and after that react-native run-ios
(or android) works fine.
Solution 3:
$ react-native run-ios
If you get this kinda error:
"Command
run-ios
unrecognized. Make sure that you have runnpm install
and that you are inside a react-native project".
In terminal, make sure you are inside a react-native project directory.
Execute this cmd:
$ react-native -v
react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory
$ npm update
$ react-native -v
react-native-cli: 2.0.1
react-native: 0.44.0
$ react-native run-ios