首页 > 解决方案 > 无法在反应本机应用程序中解析包

问题描述

我在我的 react native 中删除了一些包。从所有文件中删除了包导入。完成后,即使我使用以下过程清除缓存,我的应用程序也无法启动。

rm -rf node_modules # 使用 Yarn 工作区,你可能需要 # 删除每个工作区中的 node_modules yarn cache clean yarn watchman watch-del-all rm -fr $TMPDIR/haste-map-* rm -rf $TMPDIR/metro-cache expo开始--清除

这是我的错误

构建 JavaScript 包失败。无法从 /Users//Desktop/react-native-with-firebase-course/my-test-project/screens/Home.js 解析模块 cloudinary-react:在项目中找不到 cloudinary-react。

如果您确定该模块存在,请尝试以下步骤:

  1. 清除守望者手表:watchman watch-del-all
  2. 删除 node_modules 并运行 yarn install
  3. 重置 Metro 的缓存:yarn start --reset-cache
  4. 删除缓存:rm -rf /tmp/metro-* 7 | 从'react-native-paper'导入{Card,Button};8 | 从'../database/firebaseDb'导入firebase;

9 | 从 'cloudinary-react' 导入 {Image as Image1, Transformation, Placeholder} | ^ 10 | 11 | 导入 { createStackNavigator, createAppContainer } from 'react-navigation'; 12 | 构建 JavaScript 包失败。无法从 /Users//Desktop/react-native-with-firebase-course/my-test-project/screens/Home.js 解析模块 cloudinary-react:在项目中找不到 cloudinary-react。

如果您确定该模块存在,请尝试以下步骤:

  1. 清除守望者手表:watchman watch-del-all
  2. 删除 node_modules 并运行 yarn install
  3. 重置 Metro 的缓存:yarn start --reset-cache
  4. 删除缓存:rm -rf /tmp/metro-* 7 | 从'react-native-paper'导入{Card,Button};8 | 从'../database/firebaseDb'导入firebase;

9 | 从 'cloudinary-react' 导入 {Image as Image1, Transformation, Placeholder} | ^ 10 | 11 | 导入 { createStackNavigator, createAppContainer } from 'react-navigation'; 12 |

标签: react-native

解决方案


推荐阅读