React-native 10: Version upgrade

Source: Internet
Author: User
Tags unpack


The updated version of React native will give you access to more APIs, so we can use more APIs, view views, Developer tools and other useful things. Browse the version update log will find the overall FB official development progress is still very tense, so it is very easy to lead to the old version of the situation can not be used, late may be unpredictable, this is recommended to try to update the latest official version . We all know a React Native project using Android project ,IOS Project and the Javascript Project are composed of three parts, and all three are related to packaged in the npm Package, Therefore, the project version of the update is more cumbersome. Let me explain to you The upgrade steps of the React Native project. First, view the current version
 
[email protected]:~/AwesomeProject$ react-native --version
react-native-cli: 0.2.0
react-native: 0.22.2
Second, check the latest version
 
[email protected]:~/AwesomeProject$ npm info react-native
{ name: ‘react-native‘,
  ‘dist-tags‘: { latest: ‘0.25.1‘, next: ‘0.26.0-rc‘ },
  versions:
   [ ‘0.0.0‘,
     ‘0.0.5‘,
      ... ... 
     ‘0.24.1‘,
     ‘0.25.0-rc‘,
     ‘0.25.1‘,
     ‘0.26.0-rc‘ ],
  maintainers:
  ... ... 
  dist:
   { shasum: ‘4177e70e56281cec8fb5fe76218bf6606eeb34b8‘,
     tarball: ‘https://registry.npmjs.org/react-native/-/react-native-0.25.1.tgz‘ },
  directories: {} }
Iii. upgrade dependent version
 
[email protected]:~/AwesomeProject$ npm install --save [email protected]

> [email protected] install /home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Entering directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/bufferutil/build‘
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
make: Leaving directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/bufferutil/build‘

> [email protected] install /home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Entering directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/utf-8-validate/build‘
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/utf-8-validate/build‘

> [email protected] postinstall /home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/yeoman-generator/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules/react-native
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]8.0 ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
Tip 1: If during the installation process, the error is as follows [email protected]:~/reactnativeworkspace/awesomeproject$ npm Install--save [email protected]npm err! tar.unpack error reading/home/pengcx/.npm/babel-runtime/6.6.1/package.tgznpm err! tar.unpack error reading/home/pengcx/.npm/babel-runtime/6.6.1/package.tgznpm err! tar.unpack error reading/home/pengcx/.npm/object-assign/4.1.0/package.tgznpm WARN Optional DEP failed, continuing [email protected]npm err! tar.unpack error reading/home/pengcx/.npm/babel-runtime/6.6.1/package.tgznpm err! tar.unpack error reading/home/pengcx/.npm/path-exists/1.0.0/package.tgznpm WARN Optional DEP failed, continuing [email protected]NPM err! Linux 3.13.0-85-genericnpm err! argv "/usr/bin/nodejs" "/USR/BIN/NPM" "Install" "--save" "[email protected]"npm err! node v4.4.3npm err! npm v2.15.1npm err! 0-byte tarballNPM err! Please run ' npm cache clean 'NPM err!NPM err! If you need help, your may report this error at:NPM err! NPM err! Please include the following file with any support request:NPM err! /home/pengcx/reactnativeworkspace/awesomeproject/npm-debug.log Processing:NPM cache Clean iv. Updating the template file for your project new npm The span lang= "ZH-CN" pack contains updates to some of the dynamic files that are generated when you run react-nativeinit init When you create a project, you build iOS and Android sub-projects, and we can get the latest code with the following commands:
 
[email protected]:~/AwesomeProject$ react-native upgrade
Upgrading project to react-native v0.25.1
Be sure to read the release notes and breaking changes:
https://github.com/facebook/react-native/releases/tag/v0.25.0
 conflict .gitignore
? Overwrite .gitignore? overwrite
    force .gitignore
identical .watchmanconfig
   create .buckconfig
identical ios/AwesomeProject/AppDelegate.h
identical ios/AwesomeProject/AppDelegate.m
identical ios/AwesomeProject/Base.lproj/LaunchScreen.xib
identical ios/AwesomeProject/Images.xcassets/AppIcon.appiconset/Contents.json
identical ios/AwesomeProject/Info.plist
identical ios/AwesomeProject/main.m
 conflict ios/AwesomeProjectTests/AwesomeProjectTests.m
? Overwrite ios/AwesomeProjectTests/AwesomeProjectTests.m? overwrite
    force ios/AwesomeProjectTests/AwesomeProjectTests.m
identical ios/AwesomeProjectTests/Info.plist
identical ios/AwesomeProject.xcodeproj/project.pbxproj
identical ios/AwesomeProject.xcodeproj/xcshareddata/xcschemes/AwesomeProject.xcscheme
 conflict android/build.gradle
? Overwrite android/build.gradle? overwrite
    force android/build.gradle
identical android/gradle.properties
identical android/settings.gradle
   create android/app/BUCK
 conflict android/app/build.gradle
? Overwrite android/app/build.gradle? overwrite
    force android/app/build.gradle
 conflict android/app/proguard-rules.pro
? Overwrite android/app/proguard-rules.pro? overwrite
    force android/app/proguard-rules.pro
identical android/app/src/main/java/com/awesomeproject/MainActivity.java
To run your app on iOS:
   cd /home/pengchengxiang/AwesomeProject
   react-native run-ios
   - or -
   Open /home/pengchengxiang/AwesomeProject/ios/AwesomeProject.xcodeproj in Xcode
   Hit the Run button
To run your app on Android:
   Have an Android emulator running (quickest way to get started), or a device connected
   cd /home/pengchengxiang/AwesomeProject
   react-native run-android
It checks your files, compares the latest versions, and then does several things : if it is a newly added file, it will be created directlyif the updated file is the same as the file for the current project, the skip is ignored directlyif the updated file and the current project's file is different, there is a conflict, it will let us choose whether to keep the original file or with the updated file coverage, this depends on the actual situation.


React-native 10: Version upgrade


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.