How to check React native version and the other information related to the app you are developing? This React Native version check commands can be varied whether you have installed React Native globally or locally without the -g (Installed when init react native project). So there are two ways to check React Native version.
- Version from the package.json file
- Command line
Checking react version from the package.json file
You can navigate to your project root folder and there you can find the package.json file. There you can find the React Native version but if you want to know more info you have to run commands with the command line.
How to check React native version from the command line / Terminal?
For this first, you have to check if you have installed React Native globally or not. For that, you can open the terminal and type below command.
npm ls react-native -g
You can see this after installing React Native globally.
The below images can be seen if React Native is not globally installed.
How to check my React Native version when installed globally?
You can open the command line / Terminal and type the following commands.
react-native --version
– This will output the current React Native CLI version.
react-native info
– This will output more information line exact react native version, react version etc. The below image shows the details that you can see.
This image is taken from a device in which the React native is not installed globally. So that’s why the npmGlobalPackages is set to Not Found. If React Native is installed globally some fields of this above image can be seen.
Also, you can try these commands as well. The outputs for the below commands are examples.
npm view react-native version
Output is: 0.63.4
npm view react version
17.0.1
npm view react-scripts version
4.0.1
npm view react-dom version
17.0.1`
So from the above commands, you will able to know the versions and different info related to versions. Now let’s see what commands will work when we are installing React Native locally with the project itself.
how to check version of React Native when installing with the project itself?
If you installed React Native without the global flag -g then you have to open the terminal and you need to navigate to the respective project root folder. Then you can use the following commands.
npx react-native --version
– This will output the CLI version
npx react-native info
– This outputs more info rather than React Native version. This information is the same as the above image when installed globally.
If you have yarn installed you can use,
yarn react-native --version
yarn react-native info
You can use these commands in any OS Mac, Windows or Ubuntu.
That’s Pretty much for this. If you have any questions or queries please add a comment or contact us via mail at [email protected].
Leave A Comment