Yousef Hamza
Yousef Hamza

Reputation: 375

How to check react-native version of project?

I'm writing a react-native component and I use events but my native module doesn't build on older version of react when sending events were by bridge.eventDispatcher..

So is there a way to check the version to switch between react and react-native modules implementations? Thanks.

Upvotes: 6

Views: 19262

Answers (2)

martinarroyo
martinarroyo

Reputation: 9701

If you type react-native --version inside a project, it will tell you the installed version.

Tested with react-native-cli version 2.0.1, can be installed with:

npm install -g react-native-cli

Note that if you're running multiple node versions you may have to install the CLI for each node version. Also, you may first have to run npm install on the project.

Upvotes: 6

Burak Karasoy
Burak Karasoy

Reputation: 1690

check remote version of react-native

npm info react-native version

check version of react-native

npm list --depth=0

remove older version of react-native

npm --save remove react react-native

Install x version of react-native

npm --save [email protected] //maybe 0.30.0

Note that you can use these commands for all modules in node_modules folder. Also you can check your react-native version in package.json file which is in your project.

'Before doing any changes be sure that problem is about incompability between react and react-native version' so had better share complete error log.

Upvotes: 15

Related Questions