问题描述
在使用 npm install 命令后,我克隆了 React-native-navigation 并定向到 Example 以运行应用程序。
克隆网址:https ://github.com/wix/react-native-navigation
屏幕截图 2017 年 10 月 26 日上午 8 点 56 分 29 分
环境
- Npm : 5.5.1
- 反应原生 cli:2.0.1
- 反应原生:0.45.1
- React Native Navigation 版本:最新
- 平台(iOS、Android 或两者?):(MacOS Sierra:10.12.6(16G29,两者)
- 设备信息(模拟器/设备?操作系统版本?调试/发布?):版本 10.0 (SimulatorApp-829.6 CoreSimulator-494.22.3)/Debug
AppDelegate.m:
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
// **********************************************
// *** DON'T MISS: THE NEXT LINE IS IMPORTANT ***
// **********************************************
#import "RCCManager.h"
// IMPORTANT: if you're getting an Xcode error that RCCManager.h isn't found, you've probably ran "npm install"
// with npm ver 2. You'll need to "npm install" with npm 3 (see https://github.com/wix/react-native-navigation/issues/1)
#import <React/RCTRootView.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
#ifdef DEBUG
//jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
// **********************************************
// *** DON'T MISS: THIS IS HOW WE BOOTSTRAP *****
// **********************************************
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
[[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];
//self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
/*
// original RN bootstrap - remove this part
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"example"
initialProperties:nil
launchOptions:launchOptions];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
*/
return YES;
}
@end
错误日志
Loading dependency graph...2017-10-26 11:15 node[1963] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-10-26 11:15 node[1963] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-10-26 11:15 node[1963] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
ERROR Error watching file for changes: EMFILE
{"code":"EMFILE","errno":"EMFILE","syscall":"Error watching file for changes:","filename":null}
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1018:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1420:11)
Loading dependency graph...~