gpt4 book ai didi

reactjs - React Native 升级到 0.56 版本后崩溃。可能是 Babel 问题?

转载 作者:行者123 更新时间:2023-12-03 13:15:17 26 4
gpt4 key购买 nike

使用 react-native-git-upgrade 升级我的 React Native 项目后,出现以下错误:

error: bundling failed: TypeError: Cannot read property 'bindings' of null
at Scope.moveBindingTo (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/scope/index.js:978:13)
at BlockScoping.updateScopeInfo (/Users/jan/Startup/react-native/ordersome/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
at BlockScoping.run (/Users/jan/Startup/react-native/ordersome/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
at PluginPass.BlockStatementSwitchStatementProgram (/Users/jan/Startup/react-native/ordersome/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
at newFn (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/visitors.js:237:21)
at NodePath._call (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/path/context.js:65:20)
at NodePath.call (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/path/context.js:100:12)
at TraversalContext.visitQueue (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/context.js:142:16)

这个问题好像和babel有关系。我重新启动了地铁和模拟器,但这并没有改变什么。这里还有我安装的所有与 babel (package.json) 有关的软件包:

"babel-eslint": "^8.2.5",
"babel-jest": "23.2.0",
"babel-preset-react-native": "4.0.0",

这是我的 .babelrc:

{
"presets": ["react-native"]
}

当项目还处于 0.55 时,我使用 react-native init 生成了该项目。

最佳答案

尝试更新 package.json 中 babel-preset-react-native 的版本,如下所示:

“babel-preset-react-native”:“^5”

关于reactjs - React Native 升级到 0.56 版本后崩溃。可能是 Babel 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51178388/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com