reactjs – React-Native 0.52:Metro Bundler遇到内部错误
发布时间:2020-12-15 20:30:34 所属栏目:百科 来源:网络整理
导读:我将项目从0.51.0和16.0升级到React-Native 0.52.0和React 16.2,现在当我尝试使用XCode(或通过CLI)运行它时,我收到以下错误: 终端输出: 2018-01-20 06:19:16.972 [info][tid:main][RCTCxxBridge.mm:210] Initializing RCTCxxBridge: 0x6000001c2850 (paren
我将项目从0.51.0和16.0升级到React-Native 0.52.0和React 16.2,现在当我尝试使用XCode(或通过CLI)运行它时,我收到以下错误:
终端输出: 2018-01-20 06:19:16.972 [info][tid:main][RCTCxxBridge.mm:210] Initializing <RCTCxxBridge: 0x6000001c2850> (parent: <RCTBridge: 0x6040000c7620>,executor: (null)) 2018-01-20 06:19:16.975378-0800 LevelStory[67373:2037856] Initializing <RCTCxxBridge: 0x6000001c2850> (parent: <RCTBridge: 0x6040000c7620>,executor: (null)) 2018-01-20 06:19:17.158 [warn][tid:main][RCTBridge.m:120] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()? 2018-01-20 06:19:17.158401-0800 LevelStory[67373:2037856] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()? 2018-01-20 06:19:17.215 [warn][tid:main][RCTModuleData.mm:69] Module RCTImageLoader requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of. 2018-01-20 06:19:17.215060-0800 LevelStory[67373:2037856] Module RCTImageLoader requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of. 2018-01-20 06:19:17.231 [info][tid:main][RCTRootView.m:302] Running application LevelStory ({ initialProps = { }; rootTag = 1; }) 2018-01-20 06:19:17.231250-0800 LevelStory[67373:2037856] Running application LevelStory ({ initialProps = { }; rootTag = 1; }) 2018-01-20 06:19:17.345 [error][tid:NSOperationQueue 0x6040000355a0 (QOS: UNSPECIFIED)][RCTCxxBridge.mm:419] Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Metro Bundler has encountered an internal error,please check your terminal error output for more details (null)) 2018-01-20 06:19:17.346054-0800 LevelStory[67373:2038114] Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Metro Bundler has encountered an internal error,please check your terminal error output for more details (null)) 我已经尝试删除并重新安装node_modules文件夹,清理缓存,清理守望者,重新链接库无济于事.我在使用react-native init创建的全新项目时遇到了同样的问题. Environment: OS: macOS Sierra 10.12.6 Node: 9.4.0 Yarn: 1.3.2 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 2.3 AI-162.3871768 Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.52.0 => 0.52.0 解决方法
跟着这些步骤:
> sudo lsof -i:<你的端口>>运行sudo kill -9< PID>>将节点降级到版本8>再次运行该应用程序 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |