[英]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. 我有一个ios react本机应用程序,我想添加android部分。
I do not understand this line in the docs 我不明白文档中的这一行
Update the react-native dependency in your package.json file to the latest version 将package.json文件中的react-native依赖项更新为最新版本
Currently my package.json file looks like this 目前我的package.json文件看起来像这样
{
"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 任何帮助将不胜感激
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 在控制台写入npm outdated
此命令显示您需要更新的最新版本,您需要在package.json中修改当前版本的最新版本并保存
after write in console npm update --save
在控制台中写入npm update --save
The "react-native dependency" is the part which indicates the react-native version you're working with. “react-native依赖”是指示您正在使用的react-native版本的部分。
In your case it's 0.15.0: "react-native": "^0.15.0"
. 在你的情况下它是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"
. 目前最新版本的react native是0.18 ,所以根据您提到的建议,您应该将版本更改为: "react-native": "^0.18.0"
。
You'll then need to run npm update
to update the package. 然后,您需要运行npm update
来更新软件包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.