Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native version check

I wanted to check the version of the react native I was using in my project when I used the command from my root folder :

D:\Reactnative\Albums>npm view react-native version
0.56.0

The version was 0.56.0 which is not the version I have installed, but on:

D:\Reactnative\Albums>react-native -v
react-native-cli: 2.0.1
react-native: 0.55.4

The version mentioned here is 0.55.4, which is correct. So why this conflict?

like image 590
Mayank Raj Avatar asked Jul 07 '18 05:07

Mayank Raj


People also ask

What is the current version of react-native?

We are excited to release a new version of React Native, 0.70.

Where can I find react-native version in project?

If you type react-native --version inside a project, it will tell you the installed version (tested with react-native-cli v. 2.0. 1).

What version of react with react-native?

React 18 enabled by default​ Starting in React Native 0.69, React 18 is enabled by default when you enable the New Architecture. The means you're able to use the new features in React 18 as soon as you migrate.


2 Answers

npm view react-native version

You can check the latest version of react native. You can run it under the root of your project or everywhere. Of course, you will need internet connection to check latest version.

react-native -v

If you run under the root of project, it will return the version of two npm packages, react-native-cli and react-native. Those versions are using in your project.

like image 75
Aung Myat Hein Avatar answered Sep 28 '22 10:09

Aung Myat Hein


Just wanted to clarify Aung's answer:

npm view react-native version checks globally while react-native -v ran inside project's root folder checks version of the app itself.

like image 34
dhahn Avatar answered Sep 28 '22 10:09

dhahn