描述
将回购程序克隆到一台新计算机上,并得到以下错误:
swipes@0.0.1 start C:\a\swipes-api\mobile
node node_modules/react-native/local-cli/cli.js start
Scanning 722 folders for symlinks in C:\a\swipes-api\mobile\node_modules (30ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
C:\a\swipes-api\mobile
error: bundling: NotFoundError: Cannot find entry file index.android.js in any of the roots: ["C:\\a\\swipes-api\\mobile"]
at DependencyGraph._getAbsolutePath (C:/a/swipes-api/mobile/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:280:11)
at DependencyGraph.getDependencies (C:/a/swipes-api/mobile/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:218:26)
at Resolver.getDependencies (C:/a/swipes-api/mobile/node_modules/react-native/packager/src/Resolver/index.js:107:27)
at C:/a/swipes-api/mobile/node_modules/react-native/packager/src/Bundler/index.js:591:37
at next (native)
at step (C:\a\swipes-api\mobile\node_modules\react-native\packager\src\Bundler\index.js:12:445)
at C:\a\swipes-api\mobile\node_modules\react-native\packager\src\Bundler\index.js:12:605
at process._tickCallback (internal/process/next_tick.js:103:7)
Bundling `index.android.js` 0.0% (0/1), failed.这条路在搜索的地方是正确的。我已经坚持了一整天了。
这是因为索引文件的路径中有双反斜杠吗?
npm启动-重置-缓存将导致相同的错误。运行纱线后,反应-本机运行-android也会导致同样的问题。npm运行启动--根C:\a\\mobile-没有结果。
这似乎与RN 0.45.0中的前一个问题无关。
更多信息
编辑:
所有新项目的反应-本机init导致相同的问题。我的电脑或npm的配置似乎是个问题,但我似乎无法找到这种情况发生的原因。
有什么想法吗?
发布于 2017-07-27 22:41:56
我有这个和一些像窗口上的错误。
更新npm和node帮助我解决了这个问题。
目前我有:
C:\usr\Far>node -v && npm -v
v6.11.1
3.10.10在我不更新之前,许多试验都没有成功。无论如何,像这样的错误不时地出现。重新开始。在重新启动之前做同样有帮助的事情(但可能不需要,只需重新启动):
sh -c 'rm -rf $TMP/react*'
npm cache clean其中$TMP是您的系统tmp目录,(检查那里是否存在react文件)
如果您添加或更新了一些包或类似于node_modules目录的修改,也需要这样做:
rm -rf node_modules && npm installhttps://stackoverflow.com/questions/44786655
复制相似问题