错误:捆绑失败:错误:无法从./../../react-transform-hmr/lib/index.js
解析模块P:\React Native\TryReactNative\App.js
:从./../../react-transform-hmr/lib/index.js
找不到模块P:\React Native\TryReactNative\App.js
。实际上,这些文件都不存在:
* P:\react-transform-hmr\lib\index.js(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
* P:\react-transform-hmr\lib\index.js\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
在ModuleResolver.resolveDependency(P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ node-haste \ DependencyGraph \ ModuleResolution.js:209:697)
在ResolutionRequest.resolveDependency(P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ node-haste \ DependencyGraph \ ResolutionRequest.js:83:16)
在DependencyGraph.resolveDependency(P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ node-haste \ DependencyGraph.js:222:485)
在Object.resolve(P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ lib \ transformHelpers.js:149:25)
在dependencies.map.result(P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:316:29)
在Array.map()
在resolveDependencies时(P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:312:16)
在P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:169:33
在Generator.next()
在步骤(P:\ React Native \ TryReactNative \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:271:307)
BUNDLE [android,dev] ...... / index.js▓▓▓▓▓▓▓▓▓▓▓▓░░░░80.3%(456/509):: ffff:127.0.0.1--[10 / Oct / 2018:12:44:20 +0000]“ GET /index.delta?platform=android&dev=true&minify=false HTTP / 1.1” 500-“-”“ okhttp / 3.10.0”
BUNDLE [android,dev] ...... / index.js▓▓▓▓▓▓▓▓▓▓▓▓░░░░80.3%(456/509),失败
答案 0 :(得分:0)
index.js
中找不到 app.js
。
您没有获得正确的文件路径。
答案 1 :(得分:0)
此错误是由于lastest react-native version导致的,即将发布补丁程序。
解决方法是:
react-native start --reset-cache