V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
elone
V2EX  ›  React

升级 react native 之后报错 : SyntaxError attempted to redefine property 'FileSystem'

  •  
  •   elone · 2017-07-09 20:54:14 +08:00 · 3727 次点击
    这是一个创建于 2692 天前的主题,其中的信息可能已经有所发展或是发生改变。

    原本 RN 用的 0.44 ,今天因为 0.44 的 textinput 似乎有 bug,听说升级到 0.46 可以解决,我就用了 react-native-git-upgrade 进行升级,然后就是恶梦啊。 一大堆依赖报错,经一个一个升级到对应的版本之后,最终报下面这个错:

    package.json
    
    {
      "name": "my-project",
      "version": "0.1.0",
      "private": true,
      "devDependencies": {
        "babel-eslint": "^7.2.1",
        "babel-jest": "19.0.0",
        "babel-plugin-flow-react-proptypes": "^0.21.0",
        "babel-plugin-transform-class-properties": "^6.24.1",
        "babel-plugin-transform-decorators-legacy": "^1.3.4",
        "babel-preset-react-native": "^1.9.1",
        "babel-preset-react-native-stage-0": "^1.0.1",
        "eslint": "^3.18.0",
        "eslint-config-airbnb": "^14.1.0",
        "eslint-plugin-babel": "^4.1.1",
        "eslint-plugin-import": "^2.2.0",
        "eslint-plugin-jsx-a11y": "^4.0.0",
        "eslint-plugin-react": "^6.10.3",
        "flow-bin": "^0.38.0",
        "jest": "19.0.2",
        "jest-expo": "1.0.1",
        "react-native-scripts": "0.0.29",
        "react-test-renderer": "^15.6.1"
      },
      "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
      "scripts": {
        "start": "react-native-scripts start",
        "eject": "react-native-scripts eject",
        "android": "react-native-scripts android",
        "ios": "react-native-scripts ios",
        "test": "node node_modules/jest/bin/jest.js --watch"
      },
      "jest": {
        "preset": "jest-expo"
      },
      "dependencies": {
        "axios": "^0.16.1",
        "expo": "^19.0.0-alpha.0",
        "lodash.debounce": "^4.0.8",
        "lodash.isempty": "^4.4.0",
        "mobx": "^3.1.9",
        "mobx-react": "^4.1.8",
        "native-base": "2.2.1",
        "qs": "^6.4.0",
        "react": "16.0.0-alpha.12",
        "react-native": "0.46.1",
        "react-native-easy-grid": "^0.1.11",
        "react-native-fs": "^2.3.3",
        "react-native-modalbox": "^1.3.9",
        "react-native-radio-buttons": "^0.14.0",
        "react-native-storage": "^0.2.2",
        "react-native-svg": "^5.3.0",
        "react-navigation": "^1.0.0-beta.9",
        "singleton": "^1.0.0",
        "styled-components": "^1.4.6"
      }
    }
    
    
    

    google 都搜索不到的问题,我简直是蒙了。折腾了一天,我宝贵的周日啊

    1 条回复    2017-07-14 14:31:37 +08:00
    smallpath
        1
    smallpath  
       2017-07-14 14:31:37 +08:00
    bug 用这个 pr https://github.com/facebook/react-native/pull/12923 可以解决, 升级就别升了,现在半年升两三次差不多
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3086 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 13:41 · PVG 21:41 · LAX 05:41 · JFK 08:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.