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

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

  •  
  •   elone · 131 天前 · 755 次点击
    这是一个创建于 131 天前的主题,其中的信息可能已经有所发展或是发生改变。

    原本 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
        1
    smallpath   127 天前
    bug 用这个 pr https://github.com/facebook/react-native/pull/12923 可以解决, 升级就别升了,现在半年升两三次差不多
    DigitalOcean
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   鸣谢   ·   1489 人在线   最高记录 3541   ·  
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.0 · 61ms · UTC 12:18 · PVG 20:18 · LAX 04:18 · JFK 07:18
    ♥ Do have faith in what you're doing.
    沪ICP备16043287号-1