gpt4 book ai didi

ios - react-native UIExplorer 打不开

转载 作者:技术小花猫 更新时间:2023-10-29 10:48:42 25 4
gpt4 key购买 nike

我正在尝试在 Xcode 上查看 UIExplorer。我已经按照示例进行操作,它应该很简单。它说要克隆 react-native,cd 到目录,npm install 并运行 npm start。但是,当我运行 npm start 时,出现以下错误:

react-native@0.8.0 start /Users/chiMarvine/Projects/react-native
./packager/packager.sh || true

/Users/chiMarvine/Projects/react-native/packager/packager.js:233
const dumpName = '/tmp/dump_' + Date.now() + '.json';
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

我不知道如何解决这个问题,构建成功但模拟器显示以下内容:

确保以下几点:
- 节点服务器正在运行并在同一网络上可用 - 运行
'npm start' 来自 react-native root
- 在 AppDelegate 中正确设置了节点服务器 URL

网址:http://localhost:8081?examples/UIExplorer/UIExplorerApp.ios.bundle?platform=ios&dev=true

请求超时

一些帮助会很好,谢谢!

最佳答案

我遇到了同样的问题。我的问题是我用 nvm 安装了 node 4.2.2 但没有将它设置为默认版本。运行构建过程的 shell 运行的是我默认的 node.js,它非常旧。为了修复它,我运行了:

nvm 别名默认 4.2.2

关于ios - react-native UIExplorer 打不开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32517769/

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