react-native - 无法在 iOS 模拟器错误上运行成功构建的 react-native 项目
问题描述
我正在使用react-native编写一个APP,但是今天早上我从github上拉出来后,我发现我无法运行它了。命令行中的日志如下:</p>
** 构建成功 ** 以下命令产生了分析器问题:Analyze Base/RCTModuleMethod.mm normal x86_64(1 个带有分析器问题的命令)
“react-native start”命令行中的日志如下:错误:捆绑失败:TypeError:Cannot read property 'bindings' of null at Scope.moveBindingTo (/Users/martin/Desktop/ble-server/node_modules/@babel/ traverse/lib/scope/index.js:978:13) 在 BlockScoping.updateScopeInfo (/Users/martin/Desktop/ble-server/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js: 364:17) 在 BlockScoping.run (/Users/martin/Desktop/ble-server/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12) 在 PluginPass.BlockStatementSwitchStatementProgram (/用户/martin/Desktop/ble-server/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24) 在 newFn (/Users/martin/Desktop/ble-server/node_modules/ @babel/traverse/lib/visitors.js:237:21) 在 NodePath。_call (/Users/martin/Desktop/ble-server/node_modules/@babel/traverse/lib/path/context.js:65:20) 在 NodePath.call (/Users/martin/Desktop/ble-server/node_modules/ @babel/traverse/lib/path/context.js:40:17) 在 NodePath.visit (/Users/martin/Desktop/ble-server/node_modules/@babel/traverse/lib/path/context.js:100: 12) 在 TraversalContext.visitQueue (/Users/martin/Desktop/ble-server/node_modules/@babel/traverse/lib/context.js:142:16) BUNDLE [ios, dev] ../../index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1),失败。visitQueue (/Users/martin/Desktop/ble-server/node_modules/@babel/traverse/lib/context.js:142:16) BUNDLE [ios, dev] ../../index.js ░░░░░ ░░░░░░░░░░░ 0.0% (0/1),失败。visitQueue (/Users/martin/Desktop/ble-server/node_modules/@babel/traverse/lib/context.js:142:16) BUNDLE [ios, dev] ../../index.js ░░░░░ ░░░░░░░░░░░ 0.0% (0/1),失败。
我怎么能再次运行它,似乎代码没有问题。
解决方案
您可能错误地更新了 react-native 请查看文档。你可能用过
npm 审计修复它更新了 react-native。
要解决此问题,您可以使用降级应用程序的 react-native 版本
npm install react-native@xxx"
然后重新编译项目
react-native run-ios"
并且不要忘记重新启动捆绑器
反应原生开始
然后,如果您仍想升级 react-native 版本,您可以使用
反应本机 git 升级
推荐阅读
- reactjs - 如何在 localStorage 中保存结帐数据并在订单完成使用 React Hooks 时将其删除?
- sql - 如何在 MSSQL 中获取最近 6 周的开始日期和结束日期
- cognos - 为 Cognos 设置仪表板过滤器的参数化 URL
- telegram - 电报机器人如何知道在哪里响应?
- azure - Azure 混合连接 - GatewayTimeout
- linux - 实现 wc 和 head 控件的功能
- django - 如何在 django models.py 中为用户名(不是用户 ID)创建 ForeignKey
- java - 在在线编译器 jdoodle.com 上运行 java 并遇到一些问题
- fiware - Orion 是否与 AWS DocumentDB 兼容
- php - 如何使用 REST API 和 PHP 向页面添加附件?