React Native项目从0.28升级到0.29 (iOS)

来源:互联网 发布:永久封的淘宝店能解吗 编辑:程序博客网 时间:2024/06/07 05:16

React Native项目从0.28升级到0.29 (iOS)


备忘纪要:


1.升级react-native到0.29.0版本 

方法一:

到项目跟目录下,cmd运行命令: react-native-git-upgrade 0.29.0,运行完毕后,应该没有ERROR类型的消息,会有一些提示信息:需要修改等等,表示react-native升级成功。

参考文章:http://blog.csdn.net/jiangbo_phd/article/details/54693335

方法二:

用 react-nativve-git-upgrade 0.29.0升级失败的情况下,手动升级,方法如下:


Alternative

Use this only in case the above didn't work.

1. Upgrade the react-native dependency

Note the latest version of the react-native npm package from here (or use npm info react-native to check).

Now install that version of react-native in your project with npm install --save:

$ npm install --save react-native@X.Y# where X.Y is the semantic version you are upgrading tonpm WARN peerDependencies The peer dependency react@~R included from react-native...

If you saw a warning about the peerDependency, also upgrade react by running:

$ npm install --save react@R# where R is the new version of react from the peerDependency warning you saw

2. Upgrade your project templates(慎用react-native upgrade,如果不熟悉iOS开发,最好是不要执行这一步,只执行第一步既可以:npm install --save react-native@X.Y

The new npm package may contain updates to the files that are normally generated when you run react-native init, like the iOS and the Android sub-projects.

You may consult rn-diff to see if there were changes in the project template files. In case there weren't any, simply rebuild the project and continue developing. In case of minor changes, you may update your project manually and rebuild.

If there were major changes, run this in a terminal to get these:

$ react-native upgrade

This will check your files against the latest template and perform the following:

  • If there is a new file in the template, it is simply created.
  • If a file in the template is identical to your file, it is skipped.
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.


2.  没有使用react-native upgrade命令,这个命令会修改相关模板文件,导致原项目中很多地方需要修改,本次升级并没有使用

慎用react-native upgrade,如果不熟悉iOS开发,最好是不要执行这一步,只执行第一步既可以:npm install --save react-native@X.Y


3. 链接项目RCTWebSocket.m文件编译时,会提示没有处理返回值,按照下面截图的方式处理;

如果有其他项目编译出错,则按照提示进行修改




4. 注意:命令执行完毕后,会自动把之前的某些第三方的插件删除(node_modules目录下),具体原因未知,从原来的备份的文件中将丢失的模块拷贝到升级后的项目中既可。


阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 明矾在哪里可以买到 明矾的作用与用途 食用明矾的功效与作用 明矾可以食用吗 明矾有什么作用 明矾水 1吨水用多少明矾 明矾又叫什么 明矾哪里有卖 明矾泡脚 明矾多少钱一吨 工业明矾 明矾哪里可以买到 明矾那里有卖 明矾可以泡脚吗 明矾在哪里买 明矾粉 明矾豆腐 明矾泡脚的作用 明矾是什么东西 明矾可做净水剂 明矾作净水剂 明矾炸油条 明矾狐臭 油条 明矾 明矾油条 明矾可用作净水剂 明矾做净水剂 明矾为什么能净水 白矾和明矾是一样的吗 明矾净水剂 明矾洗脚 泡打粉 明矾 明矾对人体有害吗 油条加明矾 明矾石 海明码 明码标价 汉明码 明码生物 雪乡明码标价