【问题标题】:Error react native running base starter app from bundle错误从捆绑包中反应本机运行的基本启动器应用程序
【发布时间】:2016-09-12 09:31:20
【问题描述】:

当我打开 xcode 项目并尝试运行时,浏览 react-native 教程(安装先决条件,然后安装“react-native init AwesomeProject”和“react-native run-ios”,在模拟器中运行良好)从本地包(AppDelegate.m 中的选项 2)我收到以下错误: /Users/webb/projects/nativeapp/fuel/node_modules/node-haste/lib/index.js:331 Object.assign(DependencyGraph, { ^ TypeError: Object.assign is not a function at Object.<anonymous> (/Users/webb/projects/nativeapp/fuel/node_modules/node-haste/lib/index.js:331:8) at Module._compile (module.js:430:26) at Module._extensions..js (module.js:448:10) at Object.require.extensions.(anonymous function) [as .js] (/Users/webb/projects/nativeapp/fuel/node_modules/babel-register/lib/node.js:166:7) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (index.js:16:30) at Module._compile (module.js:430:26) Command /bin/sh failed with exit code 1 如果我在发布或调试构建配置中运行,错误仍然存​​在。并且发生在模拟器和设备上。几乎我只能运行配置为选项 1(从开发服务器加载)的 AppDelegate.m 的示例应用程序,当我想发布我的应用程序时它不会运行。

我尝试了节点 5.8 和 6.1。其他人能想到调试的下一步吗?这只是基本示例应用程序,它应该从本地包中运行,对吧?

"dependencies": { "react": "^0.14.8", "react-native": "^0.25.1" } 我在mac上,没试过android,但iOS肯定不能用。

【问题讨论】:

  • React Native 0.26 昨天发布了,它也有同样的问题。没有人从捆绑包中运行这些示例应用程序吗?

标签: ios iphone xcode react-native


【解决方案1】:

我在新机器上重新开始,在新机器上一切正常。所以我的旧机器上显然有问题,我发现提到 Babel 的全局 CLI 安装会导致我看到的时髦问题。这可能是这种情况,尽管在我卸载 Babel 后它仍然存在。

如果您开始遇到此问题,我的建议是不要浪费一周的时间来解决它。重新加载您的操作系统并重新开始。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-19
    • 2021-05-18
    • 1970-01-01
    • 1970-01-01
    • 2012-04-14
    • 2018-04-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多