首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >捆绑失败:运行React-Native项目时出现错误和404

捆绑失败:运行React-Native项目时出现错误和404
EN

Stack Overflow用户
提问于 2017-10-09 22:50:14
回答 1查看 1.4K关注 0票数 2

我有一个使用npm start -- --reset-cache运行的React-Native应用程序。然后我运行react-native run-android

但是,我在npm服务器的控制台中遇到了这个问题:

代码语言:javascript
复制
Bundling `index.js`  [development, non-minified]  0.0% (0/1), failed.
error: bundling failed: Error
    at DependencyGraph._getAbsolutePath (/myProjectPath/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:305:11)
    at DependencyGraph.getDependencies (/myProjectPath/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:283:4236)
    at Resolver.getDependencies (/myProjectPath/node_modules/metro-bundler/src/Resolver/index.js:129:5)
    at /myProjectPath/node_modules/metro-bundler/src/Bundler/index.js:642:39
    at Generator.next (<anonymous>)
    at step (/myProjectPath/node_modules/metro-bundler/src/Bundler/index.js:13:1336)
    at /myProjectPath/node_modules/metro-bundler/src/Bundler/index.js:13:1496
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

然后,在Android模拟器中,我得到了:

代码语言:javascript
复制
The development server returned response error code: 404

URL: http//10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false

Body:

{"message": "Cannot find entry file index.js in any of the roots"

这让我很困惑。既然我是在安卓模拟器上,为什么它要寻找index.js而不是index.android.js呢?

你知道我该怎么解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2017-10-10 22:01:51

在0.49.1版之后,index.android.js和index.ios.js文件合并为一个文件。https://github.com/facebook/react-native/issues/16208

我知道您将不得不升级旧版本中的应用程序。我猜这一过渡将是困难的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46649280

复制
相关文章

相似问题

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