6

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?

Aung Myat Hein
  • 4,018
  • 1
  • 36
  • 42
Mayank Raj
  • 921
  • 2
  • 12
  • 23

3 Answers3

9

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.

Aung Myat Hein
  • 4,018
  • 1
  • 36
  • 42
3

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.

dhahn
  • 729
  • 9
  • 11
0

Macbook M1 Chip

npm view react-native version

Vivek
  • 4,916
  • 35
  • 40