首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到入口文件index.js

找不到入口文件index.js
EN

Stack Overflow用户
提问于 2017-10-12 23:21:30
回答 2查看 8.6K关注 0票数 8

我试着用https://github.com/evollu/react-native-fcm模块给我的应用添加推送通知。我最终得到了许多错误,并在节点上运行了许多react命令,包括uprade命令。现在在模拟器的红色屏幕上显示"Can not find entry file index.js in any of to root“,当我查看ReactPackager时,它显示:

代码语言:javascript
复制
Loading dependency graph, done. Bundlingindex.js[development, non-minified] 0.0% (0/1), failed. error: bundling failed: Error at DependencyGraph._getAbsolutePath (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:305:11) at DependencyGraph.getDependencies (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:283:4236) at Resolver.getDependencies (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Resolver/index.js:129:5) at /Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Bundler/index.js:642:39 at Generator.next (<anonymous>) at step (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Bundler/index.js:13:1336) at /Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Bundler/index.js:13:1496 at process._tickCallback (internal/process/next_tick.js:103:7)

这是我的package.json:https://pastebin.com/2CsXCyJt

感谢任何帮助..。

EN

回答 2

Stack Overflow用户

发布于 2017-11-17 14:21:07

从react native 0.49.1开始,有一个突破性的变化,将您的index.android.js和index.ios.js合并到index.js中。有关更多详细信息,请参阅Github中的此问题

票数 10
EN

Stack Overflow用户

发布于 2018-05-17 18:20:39

您可以尝试以下步骤

  1. (in project directory) mkdir android/app/src/main/assets
  2. react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
  3. react-native run-android
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46713322

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档