React native 绑定失败:TypeError:无法读取属性';绑定';在Scope.moveBindingTo处为null

React native 绑定失败:TypeError:无法读取属性';绑定';在Scope.moveBindingTo处为null,react-native,react-native-android,babeljs,react-native-ios,React Native,React Native Android,Babeljs,React Native Ios,我已将react native更新为0.59.5,出现以下错误: bundling failed: TypeError: Cannot read property 'bindings' of null at Scope.moveBindingTo (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/scope/index.js:864:13) at convertBlockScopedToVar (/Users/b

我已将react native更新为0.59.5,出现以下错误:

bundling failed: TypeError: Cannot read property 'bindings' of null
    at Scope.moveBindingTo (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/scope/index.js:864:13)
    at convertBlockScopedToVar (/Users/ben/vepo/frontend/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:139:13)
    at PluginPass.VariableDeclaration (/Users/ben/vepo/frontend/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:26:9)
    at newFn (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitSingle (/Users/ben/vepo/frontend/node_modules/@babel/traverse/lib/context.js:90:19)
我见过将巴别塔Preact native升级到5.0.2的解决方案。我这样做了,但没有成功。另一个解决方案是使用metro react native babel preset。那也没用。另一个解决方案是使用
@babel/preset env
。那也没用。我甚至注释掉了错误所抱怨的代码,所以我甚至不知道它现在如何在注释掉的代码行上给出相同的错误…有什么想法吗

package.json

{
  "name": "vepo",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "rnpm": {
    "assets": [
      "./app/fonts"
    ]
  },
  "jest": {
    "preset": "react-native",
    "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
      "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
    }
  },
  "dependencies": {
    "@babel/core": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "babel-preset-react-native": "5.0.2",
    "flow-typed": "^2.4.0",
    "generator-rn-toolbox": "^2.2.0",
    "imagemagick": "^0.1.3",
    "immutable": "4.0.0-rc.9",
    "list": "^2.0.15",
    "metro-bundler": "^0.22.1",
    "metro-react-native-babel-preset": "^0.53.1",
    "native-base": "^2.3.3",
    "prop-types": "^15.5.10",
    "react": "16.8.3",
    "react-native": "0.59.5",
    "react-native-aws3": "^0.0.8",
    "react-native-blur": "^3.1.3",
    "react-native-check-box": "^2.1.0",
    "react-native-communications": "^2.2.1",
    "react-native-drawer": "^2.3.0",
    "react-native-easy-toast": "^1.2.0",
    "react-native-elements": "^0.19.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-gesture-handler": "1.0.12",
    "react-native-git-upgrade": "^0.2.7",
    "react-native-image-picker": "^0.26.7",
    "react-native-interactable": "0.1.2",
    "react-native-mail": "^3.0.2",
    "react-native-maps": "^0.16.4",
    "react-native-modal": "^2.3.2",
    "react-native-modalbox": "^1.3.9",
    "react-native-multiple-choice": "^0.0.8",
    "react-native-navigation": "^1.1.100",
    "react-native-off-canvas-menu": "^0.1.31",
    "react-native-optimized-flatlist": "^1.0.1",
    "react-native-redux-router": "^1.0.7",
    "react-native-root-toast": "^3.0.2",
    "react-native-select-multiple": "^1.0.3",
    "react-native-side-menu": "^0.20.1",
    "react-native-vector-icons": "^5.0.0",
    "react-navigation": "3.0.8",
    "react-navigation-tabs": "^1.0.1",
    "react-redux": "^5.0.3",
    "redux": "^3.6.0",
    "redux-immutable": "^4.0.0",
    "redux-observable": "^0.14.1",
    "redux-thunk": "^2.3.0",
    "reselect": "^3.0.0",
    "rxjs": "^5.2.0",
    "yarn": "^1.3.2",
    "yoga": "^0.0.0"
  },
  "devDependencies": {
    "adm-zip": "^0.4.11",
    "babel-cli": "^6.26.0",
    "babel-eslint": "^7.1.1",
    "babel-plugin-module-resolver": "^2.7.0",
    "babel-preset-flow": "^6.23.0",
    "eslint": "^3.17.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-flowtype": "^2.30.3",
    "eslint-plugin-jsx": "^0.0.2",
    "eslint-plugin-react": "^6.10.0",
    "eslint-plugin-react-native": "^2.3.1",
    "flow-bin": "^0.75.0",
    "plist": "^2.1.0",
    "react-devtools": "^3.2.1",
    "react-test-renderer": "~15.4.1",
    "redux-devtools": "^3.3.2",
    "remote-redux-devtools": "^0.5.7",
    "remotedev-server": "^0.2.4",
    "xcode": "^1.0.0"
  }
}
{
  "name": "vepo",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "rnpm": {
    "assets": [
      "./app/fonts"
    ]
  },
  "jest": {
    "preset": "react-native",
    "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
      "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
    }
  },
  "dependencies": {
    "@babel/core": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "babel-preset-react-native": "5.0.2",
    "flow-typed": "^2.4.0",
    "generator-rn-toolbox": "^2.2.0",
    "imagemagick": "^0.1.3",
    "immutable": "4.0.0-rc.9",
    "list": "^2.0.15",
    "metro-bundler": "^0.22.1",
    "metro-react-native-babel-preset": "^0.53.1",
    "native-base": "2.12.1",
    "prop-types": "^15.5.10",
    "react": "16.8.3",
    "react-native": "0.59.5",
    "react-native-aws3": "^0.0.8",
    "react-native-blur": "^3.1.3",
    "react-native-check-box": "^2.1.0",
    "react-native-communications": "^2.2.1",
    "react-native-drawer": "^2.3.0",
    "react-native-easy-toast": "^1.2.0",
    "react-native-elements": "^0.19.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-gesture-handler": "1.0.12",
    "react-native-git-upgrade": "^0.2.7",
    "react-native-image-picker": "^0.26.7",
    "react-native-interactable": "0.1.2",
    "react-native-mail": "^3.0.2",
    "react-native-maps": "^0.16.4",
    "react-native-modal": "^2.3.2",
    "react-native-modalbox": "^1.3.9",
    "react-native-multiple-choice": "^0.0.8",
    "react-native-navigation": "^1.1.100",
    "react-native-off-canvas-menu": "^0.1.31",
    "react-native-optimized-flatlist": "^1.0.1",
    "react-native-redux-router": "^1.0.7",
    "react-native-root-toast": "^3.0.2",
    "react-native-select-multiple": "^1.0.3",
    "react-native-side-menu": "^0.20.1",
    "react-native-vector-icons": "^5.0.0",
    "react-navigation": "3.0.8",
    "react-navigation-tabs": "^1.0.1",
    "react-redux": "^5.0.3",
    "react-timer-mixin": "^0.13.4",
    "redux": "^3.6.0",
    "redux-immutable": "^4.0.0",
    "redux-observable": "^0.14.1",
    "redux-thunk": "^2.3.0",
    "reselect": "^3.0.0",
    "rxjs": "^5.2.0",
    "yarn": "^1.3.2",
    "yoga": "^0.0.0"
  },
  "devDependencies": {
    "adm-zip": "^0.4.11",
    "babel-cli": "^6.26.0",
    "babel-eslint": "^7.1.1",
    "babel-plugin-module-resolver": "^2.7.0",
    "babel-preset-flow": "^6.23.0",
    "eslint": "^3.17.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-flowtype": "^2.30.3",
    "eslint-plugin-jsx": "^0.0.2",
    "eslint-plugin-react": "^6.10.0",
    "eslint-plugin-react-native": "^2.3.1",
    "flow-bin": "^0.75.0",
    "plist": "^2.1.0",
    "react-devtools": "^3.2.1",
    "react-test-renderer": "~15.4.1",
    "redux-devtools": "^3.3.2",
    "remote-redux-devtools": "^0.5.7",
    "remotedev-server": "^0.2.4",
    "xcode": "^1.0.0"
  }
}

当我重新启动计算机时,它工作了

有效的代码:

.babelrc

{
  "presets": ["@babel/preset-env"]
}
{
  "presets": ["module:metro-react-native-babel-preset"]
}
package.json

{
  "name": "vepo",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "rnpm": {
    "assets": [
      "./app/fonts"
    ]
  },
  "jest": {
    "preset": "react-native",
    "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
      "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
    }
  },
  "dependencies": {
    "@babel/core": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "babel-preset-react-native": "5.0.2",
    "flow-typed": "^2.4.0",
    "generator-rn-toolbox": "^2.2.0",
    "imagemagick": "^0.1.3",
    "immutable": "4.0.0-rc.9",
    "list": "^2.0.15",
    "metro-bundler": "^0.22.1",
    "metro-react-native-babel-preset": "^0.53.1",
    "native-base": "^2.3.3",
    "prop-types": "^15.5.10",
    "react": "16.8.3",
    "react-native": "0.59.5",
    "react-native-aws3": "^0.0.8",
    "react-native-blur": "^3.1.3",
    "react-native-check-box": "^2.1.0",
    "react-native-communications": "^2.2.1",
    "react-native-drawer": "^2.3.0",
    "react-native-easy-toast": "^1.2.0",
    "react-native-elements": "^0.19.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-gesture-handler": "1.0.12",
    "react-native-git-upgrade": "^0.2.7",
    "react-native-image-picker": "^0.26.7",
    "react-native-interactable": "0.1.2",
    "react-native-mail": "^3.0.2",
    "react-native-maps": "^0.16.4",
    "react-native-modal": "^2.3.2",
    "react-native-modalbox": "^1.3.9",
    "react-native-multiple-choice": "^0.0.8",
    "react-native-navigation": "^1.1.100",
    "react-native-off-canvas-menu": "^0.1.31",
    "react-native-optimized-flatlist": "^1.0.1",
    "react-native-redux-router": "^1.0.7",
    "react-native-root-toast": "^3.0.2",
    "react-native-select-multiple": "^1.0.3",
    "react-native-side-menu": "^0.20.1",
    "react-native-vector-icons": "^5.0.0",
    "react-navigation": "3.0.8",
    "react-navigation-tabs": "^1.0.1",
    "react-redux": "^5.0.3",
    "redux": "^3.6.0",
    "redux-immutable": "^4.0.0",
    "redux-observable": "^0.14.1",
    "redux-thunk": "^2.3.0",
    "reselect": "^3.0.0",
    "rxjs": "^5.2.0",
    "yarn": "^1.3.2",
    "yoga": "^0.0.0"
  },
  "devDependencies": {
    "adm-zip": "^0.4.11",
    "babel-cli": "^6.26.0",
    "babel-eslint": "^7.1.1",
    "babel-plugin-module-resolver": "^2.7.0",
    "babel-preset-flow": "^6.23.0",
    "eslint": "^3.17.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-flowtype": "^2.30.3",
    "eslint-plugin-jsx": "^0.0.2",
    "eslint-plugin-react": "^6.10.0",
    "eslint-plugin-react-native": "^2.3.1",
    "flow-bin": "^0.75.0",
    "plist": "^2.1.0",
    "react-devtools": "^3.2.1",
    "react-test-renderer": "~15.4.1",
    "redux-devtools": "^3.3.2",
    "remote-redux-devtools": "^0.5.7",
    "remotedev-server": "^0.2.4",
    "xcode": "^1.0.0"
  }
}
{
  "name": "vepo",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "rnpm": {
    "assets": [
      "./app/fonts"
    ]
  },
  "jest": {
    "preset": "react-native",
    "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
      "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
    }
  },
  "dependencies": {
    "@babel/core": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "babel-preset-react-native": "5.0.2",
    "flow-typed": "^2.4.0",
    "generator-rn-toolbox": "^2.2.0",
    "imagemagick": "^0.1.3",
    "immutable": "4.0.0-rc.9",
    "list": "^2.0.15",
    "metro-bundler": "^0.22.1",
    "metro-react-native-babel-preset": "^0.53.1",
    "native-base": "2.12.1",
    "prop-types": "^15.5.10",
    "react": "16.8.3",
    "react-native": "0.59.5",
    "react-native-aws3": "^0.0.8",
    "react-native-blur": "^3.1.3",
    "react-native-check-box": "^2.1.0",
    "react-native-communications": "^2.2.1",
    "react-native-drawer": "^2.3.0",
    "react-native-easy-toast": "^1.2.0",
    "react-native-elements": "^0.19.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-gesture-handler": "1.0.12",
    "react-native-git-upgrade": "^0.2.7",
    "react-native-image-picker": "^0.26.7",
    "react-native-interactable": "0.1.2",
    "react-native-mail": "^3.0.2",
    "react-native-maps": "^0.16.4",
    "react-native-modal": "^2.3.2",
    "react-native-modalbox": "^1.3.9",
    "react-native-multiple-choice": "^0.0.8",
    "react-native-navigation": "^1.1.100",
    "react-native-off-canvas-menu": "^0.1.31",
    "react-native-optimized-flatlist": "^1.0.1",
    "react-native-redux-router": "^1.0.7",
    "react-native-root-toast": "^3.0.2",
    "react-native-select-multiple": "^1.0.3",
    "react-native-side-menu": "^0.20.1",
    "react-native-vector-icons": "^5.0.0",
    "react-navigation": "3.0.8",
    "react-navigation-tabs": "^1.0.1",
    "react-redux": "^5.0.3",
    "react-timer-mixin": "^0.13.4",
    "redux": "^3.6.0",
    "redux-immutable": "^4.0.0",
    "redux-observable": "^0.14.1",
    "redux-thunk": "^2.3.0",
    "reselect": "^3.0.0",
    "rxjs": "^5.2.0",
    "yarn": "^1.3.2",
    "yoga": "^0.0.0"
  },
  "devDependencies": {
    "adm-zip": "^0.4.11",
    "babel-cli": "^6.26.0",
    "babel-eslint": "^7.1.1",
    "babel-plugin-module-resolver": "^2.7.0",
    "babel-preset-flow": "^6.23.0",
    "eslint": "^3.17.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-flowtype": "^2.30.3",
    "eslint-plugin-jsx": "^0.0.2",
    "eslint-plugin-react": "^6.10.0",
    "eslint-plugin-react-native": "^2.3.1",
    "flow-bin": "^0.75.0",
    "plist": "^2.1.0",
    "react-devtools": "^3.2.1",
    "react-test-renderer": "~15.4.1",
    "redux-devtools": "^3.3.2",
    "remote-redux-devtools": "^0.5.7",
    "remotedev-server": "^0.2.4",
    "xcode": "^1.0.0"
  }
}
{
“名称”:“vepo”,
“版本”:“0.0.1”,
“私人”:没错,
“脚本”:{
“开始”:“node node_modules/react native/local cli/cli.js start”,
“测试”:“开玩笑”
},
“rnpm”:{
“资产”:[
“/应用程序/字体”
]
},
“笑话”:{
“预设”:“反应本机”,
“moduleNameMapper”:{
“\ \(jpg | jpeg | png | gif | eot | otf | webp | svg | ttf | woff | woff2 | mp4 | webm | wav | mp3 | m4a | aac | oga |)$”:“/(uu mocks |/uu/fileMock.js,
“\\(css | less)$”:“/\uu mocks\uuu/styleMock.js”
}
},
“依赖项”:{
“@babel/core”:“^7.4.3”,
“@babel/preset env”:“^7.4.3”,
“巴别塔预设反应本机”:“5.0.2”,
“流类型”:“^2.4.0”,
“生成器rn工具箱”:“^2.2.0”,
“imagemagick”:“^0.1.3”,
“不可变”:“4.0.0-rc.9”,
“列表”:“^2.0.15”,
“metro捆绑程序”:“^0.22.1”,
“metro react native babel预设”:“^0.53.1”,
“本机基础”:“2.12.1”,
“道具类型”:“^15.5.10”,
“反应”:“16.8.3”,
“反应本机”:“0.59.5”,
“react-native-aws3”:“^0.0.8”,
“反应本机模糊”:“^3.1.3”,
“反应本机复选框”:“^2.1.0”,
“反应本机通信”:“^2.2.1”,
“反应本机抽屉”:“^2.3.0”,
“react native easy toast”:“^1.2.0”,
“反应本机元素”:“^0.19.1”,
“react native fbsdk”:“^0.8.0”,
“反应本机手势处理程序”:“1.0.12”,
“react本机git升级”:“^0.2.7”,
“反应本机映像选择器”:“^0.26.7”,
“反应本机可交互”:“0.1.2”,
“反应本机邮件”:“^3.0.2”,
“反应本机映射”:“^0.16.4”,
“反应本机模态”:“^2.3.2”,
“react native modalbox”:“^1.3.9”,
“反应本机多项选择”:“^0.0.8”,
“反应本机导航”:“^1.1.100”,
“反应本机非画布菜单”:“^0.1.31”,
“react本机优化平面列表”:“^1.0.1”,
“react native redux路由器”:“^1.0.7”,
“react native root toast”:“^3.0.2”,
“反应本机选择多个”:“^1.0.3”,
“反应本机端菜单”:“^0.20.1”,
“反应本机矢量图标”:“^5.0.0”,
“反应导航”:“3.0.8”,
“反应导航选项卡”:“^1.0.1”,
“react redux”:“^5.0.3”,
“反应计时器混合”:“^0.13.4”,
“redux”:“^3.6.0”,
“redux不可变”:“^4.0.0”,
“可观察的重复次数”:“^0.14.1”,
“redux thunk”:“^2.3.0”,
“重新选择”:“^3.0.0”,
“rxjs”:“^5.2.0”,
“纱线”:“^1.3.2”,
“瑜伽”:“^0.0.0”
},
“依赖性”:{
“adm-zip”:“^0.4.11”,
“巴别塔cli”:“^6.26.0”,
“babel eslint”:“^7.1.1”,
“巴别塔插件模块解析器”:“^2.7.0”,
“巴别塔预设流”:“^6.23.0”,
“eslint”:“^3.17.0”,
“eslint配置美观”:“^2.9.0”,
“eslint插件流类型”:“^2.30.3”,
“eslint插件jsx”:“^0.0.2”,
“eslint插件反应”:“^6.10.0”,
“eslint插件反应本机”:“^2.3.1”,
“流动箱”:“^0.75.0”,
“plist”:“^2.1.0”,
“反应开发工具”:“^3.2.1”,
“反应测试渲染器”:“~15.4.1”,
“redux开发工具”:“^3.3.2”,
“远程redux开发工具”:“^0.5.7”,
“remotedev服务器”:“^0.2.4”,
“xcode”:“^1.0.0”
}
}