简体   繁体   English

更新package.json以添加android以反应原生

[英]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.

相关问题 React Native - 从 package.json 到 android 构建清单的自动版本名称 - React Native - Automatic version name from package.json to android build manifest React Native:package.json中的平台特定代码 - React Native: Platform specific code in package.json 离子平台添加android引发package.json的语法错误 - Ionic platform add android throws Syntax error for package.json 错误:“package.json”中的 react-native 版本与“node_modules”中安装的版本不匹配 - Error: react-native version in "package.json" doesn't match the installed version in "node_modules" 如何为React Native打包一个android native模块 - How to package an android native module for React Native Phonegap 7搞砸了package.json - Phonegap 7 is messing with package.json React Native Android构建版本代码未更新 - React native android build version code not updating React-native 不会更新 android 中的更改 - React-native is not updating changes in android 我应该更新哪个build.gradle文件以在React Native Android项目中添加结构数字 - Which build.gradle file should I be updating to add fabric digits in a React Native Android project React Native package 服务器未连接到 Android 模拟器 - React Native package server not connected to Android simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM