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

2017-07-09 20:54:14 +08:00
 elone

原本 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 都搜索不到的问题,我简直是蒙了。折腾了一天,我宝贵的周日啊

3731 次点击
所在节点    React
1 条回复
smallpath
2017-07-14 14:31:37 +08:00
bug 用这个 pr https://github.com/facebook/react-native/pull/12923 可以解决, 升级就别升了,现在半年升两三次差不多

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/374118

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX