我在 IOS 模拟器中收到此错误:
cannot find entry file "examples/ReduxExample/index.js" in any of the root.
在终端:
Loading dependency graph...
React packager ready.
Loading dependency graph, done.
error: bundling: Error
at DependencyGraph._getAbsolutePath (/Users/greg_work/temp/react_native_temp/ReduxExample/node_modules/react-native/packager/src/node-haste/index.js:285:11)
at load.then (/Users/greg_work/temp/react_native_temp/ReduxExample/node_modules/react-native/packager/src/node-haste/index.js:228:28)
at process._tickCallback (internal/process/next_tick.js:109:7)
Bundling `examples/ReduxExample/index.js` 0.0% (0/1), failed.
Launching Dev Tools...
error: bundling: Error
at DependencyGraph._getAbsolutePath (/Users/greg_work/temp/react_native_temp/ReduxExample/node_modules/react-native/packager/src/node-haste/index.js:285:11)
at load.then (/Users/greg_work/temp/react_native_temp/ReduxExample/node_modules/react-native/packager/src/node-haste/index.js:228:28)
at process._tickCallback (internal/process/next_tick.js:109:7)
Bundling `examples/ReduxExample/index.js` 0.0% (0/1), failed.
这是尝试在此处运行 React Navigation redux 示例时: https ://github.com/react-community/react-navigation/tree/master/examples/ReduxExample 。
我基本上:
- 下载了 github 项目的 ZIP
- 提取 Redux Example 文件夹并将其复制到另一个区域
- 运行“npm 安装”
- react-native run-ios