Usage. Check out the example app in the example folder. import { AppInstalledChecker, CheckPackageInstallation } from 'react-native-check-app-install'; // To check by app name: AppInstalledChecker .
To see what version you have on your Mac(Window also can run that code.), run react-native -v
and you should get something like this:
If you want to know what version your project is running, look in /node_modules/react-native/package.json
and look for the version
key:
The best practice for checking the react native environment information.
react-native info
which will give the information
React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Memory: 2.08 GB / 7.67 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 8.10.0 - /usr/bin/node
Yarn: 1.12.3 - /usr/bin/yarn
npm: 3.5.2 - /usr/bin/npm
npmPackages:
react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0
npmGlobalPackages:
react-native-cli: 2.0.1
react-native: 0.57.8
You can also open your package.json
file in node_modules
-> react-native
.
The version is at the top:
{
"name": "react-native",
"version": "0.12.0",
...
}
Move to the root of your App then execute the following command,
react-native -v
In my case, it is something like below,
MacBook-Pro:~ admin$ cd projects/
MacBook-Pro:projects admin$ cd ReactNative/
MacBook-Pro:ReactNative admin$ cd src/
MacBook-Pro:src admin$ cd Apps/
MacBook-Pro:Apps admin$ cd CabBookingApp/
MacBook-Pro:CabBookingApp admin$ ls
MyComponents __tests__ app.json index.android.js
ios package.json
MyStyles android img index.ios.js
node_modules
Finally,
MacBook-Pro:CabBookingApp admin$ react-native -v
react-native-cli: 2.0.1
react-native: 0.44.0
If you want to see
which version of react-native
, react
or another one you are running, open your terminal
or cmd
and run
the desired command
npm view react-native version
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
To see the local packages installed in your project including their versions and without their dependencies, run the below command from the project's root directory. In a React native app this would include the react-native package.
npm list --depth 0
Or if you installed them with yarn:
yarn list --depth=0
And to get just a specific package:
npm list react-native --depth 0
yarn list --pattern react-native --depth=0
this works for me
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`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With