Mayank Raj
Mayank Raj

Reputation: 941

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?

Upvotes: 6

Views: 11496

Answers (3)

Vivek
Vivek

Reputation: 5213

Macbook M1 Chip

npm view react-native version

Upvotes: 0

dhahn
dhahn

Reputation: 787

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.

Upvotes: 4

Aung Myat Hein
Aung Myat Hein

Reputation: 4178

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.

Upvotes: 10

Related Questions