我试图从'expo'导入Expo。但是我收到了以下错误消息:
error: bundling failed: Error: Unable to resolve module `expo` from `C:\Users\reactnative\navigate\App.js`: Module `expo` does not exist in the Haste module map.
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
at ModuleResolver.resolveDependency (C:\Users\reactnative\navigate\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:183:15)
at ResolutionRequest.resolveDependency (C:\Users\reactnative\navigate\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (C:\Users\reactnative\navigate\node_modules\metro\src\node-haste\DependencyGraph.js:273:16)
at Object.resolve (C:\Users\reactnative\navigate\node_modules\metro\src\lib\transformHelpers.js:261:42)
at dependencies.map.result (C:\Users\reactnative\navigate\node_modules\metro\src\DeltaBundler\traverseDependencies.js:391:31)
at Array.map (<anonymous>)
at resolveDependencies (C:\Users\reactnative\navigate\node_modules\metro\src\DeltaBundler\traverseDependencies.js:388:18)
at C:\Users\reactnative\navigate\node_modules\metro\src\DeltaBundler\traverseDependencies.js:261:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (C:\Users\reactnative\navigate\node_modules\metro\src\DeltaBundler\traverseDependencies.js:87:24)
package.json中的依赖项
{ “ name”:“ navigate”, “ version”:“ 0.0.1”, “私人”:是的, “脚本”:{ “ start”:“节点node_modules / react-native / local-cli / cli.js开始”, “ test”:“开玩笑” }, “依赖关系”:{ “反应”:“ 16.6.3”, “ react-native”:“ 0.58.5”, “反应导航”:“ ^ 3.3.2” }, “ devDependencies”:{ “ babel-core”:“ 7.0.0-bridge.0”, “ babel-jest”:“ 24.1.0”, “ jest”:“ 24.1.0”, “ metro-react-native-babel-preset”:“ 0.52.0”, “ react-test-renderer”:“ 16.6.3” }, “笑话”:{ “ preset”:“ react-native” } }