1

我在 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 。

我基本上:

  1. 下载了 github 项目的 ZIP
  2. 提取 Redux Example 文件夹并将其复制到另一个区域
  3. 运行“npm 安装”
  4. react-native run-ios
4

1 回答 1

1

你试过这样

 cd examples/NavigationPlayground or Redux Example
    npm install
    cd ../..
    npm start

    # In a seperate terminal tab:
    npm run run-playground-android
    # OR:
    npm run run-playground-ios
于 2017-04-26T10:43:09.793 回答