繁体   English   中英

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

[英]bundling failed: Error and 404 when running React-Native project

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

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

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模拟器中,我得到:

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"

这使我感到困惑。 由于我在Android模拟器上,为什么为什么要寻找index.js而不是index.android.js

关于如何解决此问题的任何想法吗?

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

我了解您将必须升级旧版本的应用程序。我认为此转换将很困难。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM