Kiran Reddy
Kiran Reddy

Reputation: 347

error Can't add "react-navigation": invalid package version undefined when run yarn

I am trying to install the project packages with the command "yarn " in MacBook Pro

OS : macOS Mojave version 10.14.5
"react-native": "0.60.5",
"react": "16.8.6",
"react-navigation": "3.11.0",

yarn version 1.22.0

Please find the attached images for the reference.

Screenshot 2020-02-26 at 4 10 40 PM

and I have another Dell laptop (Windows) there I could install the dependencies with the command "yarn"

I need to install packages with the command "yarn" or "yarn install"

enter image description here

Upvotes: 2

Views: 6259

Answers (2)

Jai
Jai

Reputation: 74738

In the project root directory you can run this command to add dependencies:

yarn add react react-native react-navigation

This will add the latest available versions or you can specify the latest version to the package.json dependencies entries:

dependencies: {
    .....
    "react-navigation":"^4.0.0"
}

Upvotes: 4

yesIamFaded
yesIamFaded

Reputation: 2068

Delete any entry that is available in your package.json that starts with react-navigation and then run

yarn add react-navigation 

or take a valid react-navigation version for example:

"react-navigation": "^4.0.10",

place that inside your package.json under dependencies and run npm install

Upvotes: 1

Related Questions