Reputation: 171
Check current react native CLI version
react-native -v
react-native-cli: 1.0.0
react-native: 0.61.5
I use the following commands to upgrade global react-native-cli
verison
npm uninstall -g react-native-cli
npm install -g react-native-cli
but now check current react native cli version, it's still v1.0.0
react-native -v
react-native-cli: 1.0.0
react-native: 0.61.5
How to upgrade the react-native-cli
?
Upvotes: 5
Views: 13990
Reputation: 4641
Since you are using react-native 0.61.5
you need to install react-native-cli
version 3.0.0
or above according to Compatibility of React Native CLI.
If you have already installed a version of react-native CLI, uninstall it using
npm uninstall -g react-native-cli
Then try to install react-native CLI as below,
npm install [email protected]
Hope this will help you.
Note:
This may not work with react-native-cli
version 4.0.0
or above.
Upvotes: 0
Reputation: 10833
🍺 The Homebrew way🍺
Remove globally first if needed
npm uninstall -g react-native-cli
or
yarn remove react-native-cli
Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install it with brew
brew install react-native-cli
Upgrade in future
brew upgrade react-native-cli
Upvotes: 2