react-native - 无法在反应本机应用程序中解析包
问题描述
我在我的 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。
如果您确定该模块存在,请尝试以下步骤:
- 清除守望者手表:watchman watch-del-all
- 删除 node_modules 并运行 yarn install
- 重置 Metro 的缓存:yarn start --reset-cache
- 删除缓存: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。
如果您确定该模块存在,请尝试以下步骤:
- 清除守望者手表:watchman watch-del-all
- 删除 node_modules 并运行 yarn install
- 重置 Metro 的缓存:yarn start --reset-cache
- 删除缓存: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 |
解决方案
推荐阅读
- arrays - 如何从数组列中进行选择而不会出现格式错误的数组错误
- reactjs - Web 应用清单:下载的文件为空或已损坏
- python - Setuptools:在 package_data 中包含子目录
- c# - .NET Core 本地 Active Directory 身份验证丢失
- python - 如何确保每次光值超过 20 时蜂鸣器都会发出哔哔声
- r - 加入数据库代码问题的问题
- c - 从 const char 指针到 char 指针的赋值不给出警告
- javascript - 如何在焦点期间更改值后关注输入的结尾
- java - 如果通过另一个对象访问对象,我应该使用聚合吗?
- r - 替换数据框列中的值