[英]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我正在尝试在 MacBook Pro 中使用命令“yarn”安装项目包
OS : macOS Mojave version 10.14.5操作系统:macOS Mojave 版本 10.14.5
"react-native": "0.60.5", “反应原生”:“0.60.5”,
"react": "16.8.6", “反应”:“16.8.6”,
"react-navigation": "3.11.0", “反应导航”:“3.11.0”,
yarn version 1.22.0纱线版本 1.22.0
Please find the attached images for the reference.请找到所附图片以供参考。
Screenshot 2020-02-26 at 4 10 40 PM截图 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"我有另一台戴尔笔记本电脑(Windows),我可以使用命令“yarn”安装依赖项
I need to install packages with the command "yarn" or "yarn install"我需要使用命令“yarn”或“yarn install”安装软件包
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:这将添加最新的可用版本,或者您可以将最新版本指定到
package.json
依赖项条目:
dependencies: {
.....
"react-navigation":"^4.0.0"
}
Delete any entry that is available in your package.json
that starts with react-navigation and then run删除
package.json
中以 react-navigation 开头的任何可用条目,然后运行
yarn add react-navigation
or take a valid react-navigation version for example:或者以一个有效的 react-navigation 版本为例:
"react-navigation": "^4.0.10",
place that inside your package.json
under dependencies and run npm install
将其放在您的
package.json
依赖项下并运行npm install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.