【问题标题】:Cannot running successful built react-native project on iOS simulator error无法在 iOS 模拟器错误上运行成功构建的 react-native 项目
【发布时间】:2018-12-14 15:28:55
【问题描述】:

我正在使用react-native编写一个APP,但是今天早上我从github上拉出来后,我发现我不能再运行它了。命令行中的日志如下:

** 构建成功 ** 以下命令产生了分析器问题: 分析 Base/RCTModuleMethod.mm 正常 x86_64 (1 个带有分析器问题的命令)

“react-native start”命令行中的日志如下: 错误:捆绑失败:TypeError:无法读取 null 的属性“绑定” 在 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 (/Users/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),失败。

我怎么再运行它,代码似乎没有问题。

【问题讨论】:

    标签: react-native


    【解决方案1】:

    请先运行命令:

    npm start 然后 react-native run-ios

    【讨论】:

      【解决方案2】:

      您可能错误地更新了 react-native 请检查documentation。 你可能用过

      npm audit fix
      更新 react-native。

      要解决此问题,您可以降级应用的 react-native 版本

       npm install react-native@x.x.x" 

      然后用

      重新编译项目
      react-native run-ios"

      别忘了重启打包器

      react-native 开始

      那么,如果你还想升级 react-native 版本可以使用

      react-native-git-upgrade 

      【讨论】:

        猜你喜欢
        • 2018-03-24
        • 2021-12-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-12-21
        • 2020-10-24
        • 1970-01-01
        • 2021-05-11
        相关资源
        最近更新 更多