React Native: Command `run-ios` unrecognized
This may sound silly, but make sure you cd to your project directory. If that fails then perform the npm install in the other answers.
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.
$ 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
Just update the version of react native in your project with the following command:
$> npm install --save react-native@latest