error: bundling failed: Error: Unable to resolve modulereact-native-root-toastfrom/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/projects/com.xiaomi.demo/Main/UIComponent/ToastExample.js`: Module does not exist in the module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
Clear watchman watches: watchman watch-del-all.
Delete the node_modules folder: rm -rf node_modules && npm install.
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 (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:1476)
at ResolutionRequest.resolveDependency (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:92:16)
at DependencyGraph.resolveDependency (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/node-haste/DependencyGraph.js:271:4465)
at dependencies.map.relativePath (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:379:19)
at Array.map ()
at resolveDependencies (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:378:16)
at /Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:203:33
at Generator.next ()
at step (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:296:307)
at /Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:296:467
BUNDLE [ios, dev] projects/com.xiaomi.demo/index.ios.js ▓░░░░░░░░░░░░░░░ 10.9% (465/1411), failed.
`
是否为新品 新品
关联的产品model zmd.light.smartlight
项目ID 无项目ID
企业名称(必填) 成都智明达科技有限公司
环境
现象
error: bundling failed: Error: Unable to resolve module
react-native-root-toastfrom
/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/projects/com.xiaomi.demo/Main/UIComponent/ToastExample.js`: Module does not exist in the module map This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following:watchman watch-del-all
.node_modules
folder:rm -rf node_modules && npm install
.rm -rf /tmp/metro-bundler-cache-*
ornpm start -- --reset-cache
. 4. Remove haste cache:rm -rf /tmp/haste-map-react-native-packager-*
. at ModuleResolver.resolveDependency (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:1476) at ResolutionRequest.resolveDependency (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:92:16) at DependencyGraph.resolveDependency (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/node-haste/DependencyGraph.js:271:4465) at dependencies.map.relativePath (/Users/mac/Desktop/ReactNativeDemo/miot-plugin-sdk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:379:19) at Array.map (期望(必填) 我只想跑起来这个
com.xiaomo.demo
这个工程,观看预览。其他的上下文/日志/截图
尝试过的解决办法 不知道如何解决