react-native UIExplorer将不会打开 [英] react-native UIExplorer won't open
问题描述
我试图在Xcode上查看UIExplorer。我遵循了这个例子,应该很简单。它说要克隆反应本机,cd到目录,安装npm并运行npm启动。但是当我运行npm开始时,我会收到以下错误:
I'm trying to view the UIExplorer on Xcode. I have followed the example and it should be simple. It says to clone react-native, cd to directory, npm install and run npm start. However when I run npm start I get the following error:
react-native@0.8.0 start / Users / chiMarvine / Projects / react -native
./packager/packager.sh || true
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:在严格模式下使用const。
at exports.runInThisContext(vm.js:73:16)
在Module._compile(module.js:443:25)
在Object.Module._extensions..js(module.js:478:10)
在Module.load(module.js:355:32)
在Function。 Module._load(module.js:310:12)
在Function.Module.runMain(module.js:501:10)
启动时(node.js: 129:16)
在node.js:814:3
/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
我没有关于如何解决这个问题的想法,构建成功,但模拟器说如下:
I have no idea on how to go about this issue, the build succeeds but the simulator says the following:
确保以下内容:_
-Node服务器是运行并在同一网络上运行 - 运行
'npm start'from react-native root
- 在AppDelegate中正确设置了节点服务器URL
Ensure the following:
-Node server is running and available on the same network - run
'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
网址: http://本地主机:8081例/ UIExplorer / UIExplorerApp.io s.bundle?platform = ios& dev = true
URL: http://localhost:8081?examples/UIExplorer/UIExplorerApp.ios.bundle?platform=ios&dev=true
请求已超时
The request has timed out
有些帮助会很棒,谢谢!
Some help would be great, thanks!
推荐答案
我刚才有同样的问题,并且我的解决方案是将NodeJS版本更新为 V4.0.0
,完成后,删除反应本机文件夹,再次执行原始步骤。
I have the same problem a moment ago, and my solution is update the NodeJS version to V4.0.0
, after completing, delete the react-native folder, do the original step again.
git clone https://github.com/facebook/react-native.git
cd react-native && npm install
npm start
它正在工作,希望这可以帮助你。
it is working, hope this could help you.
这篇关于react-native UIExplorer将不会打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!