Adam Katz
Adam Katz

Reputation: 6962

updating package.json to add android to react native

I have a ios react native app and I would like to add the android part to it.

I do not understand this line in the docs

Update the react-native dependency in your package.json file to the latest version

Currently my package.json file looks like this

{
  "name": "sassi",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start"
  },
  "dependencies": {
    "react-native": "^0.15.0",
    "react-native-icons": "^0.7.0",
    "react-native-splashscreen": "^1.0.0"
  }
}

Any help would be greatly appreciated

Upvotes: 1

Views: 4877

Answers (2)

CrsCaballero
CrsCaballero

Reputation: 2348

the best way is

in console write npm outdated this command show you the latest version that you need update and you need modified your current version in your package.json with latest version and save

after write in console npm update --save

Upvotes: 3

Artal
Artal

Reputation: 9143

The "react-native dependency" is the part which indicates the react-native version you're working with.

In your case it's 0.15.0: "react-native": "^0.15.0".

The latest version of react native at the moment is 0.18, so according to the recommendation that you've mentioned, you should change the version to: "react-native": "^0.18.0".

You'll then need to run npm update to update the package.

Upvotes: 0

Related Questions