简体   繁体   English

尝试在 vanilla React Native 项目中解决 @expo/vector-icons/FontAwesome 时出错

[英]Error trying to resolve @expo/vector-icons/FontAwesome in a vanilla React Native project

I ran into this strange error today: Unable to resolve module `@expo/vector-icons/FontAwesome` from `node_modules/react-native-elements/src/checkbox/CheckBoxIcon.js`: @expo/vector-icons/FontAwesome could not be found within the project.我今天遇到了这个奇怪的错误: Unable to resolve module `@expo/vector-icons/FontAwesome` from `node_modules/react-native-elements/src/checkbox/CheckBoxIcon.js`: @expo/vector-icons/FontAwesome could not be found within the project.

This project does not use expo, it was built using vanilla React Native CLI.这个项目不使用 expo,它是使用 vanilla React Native CLI 构建的。 I checked the CheckBoxIcon.js file in node_modules and I don't see any references to @expo .我检查了node_modules中的CheckBoxIcon.js文件,但没有看到对@expo的任何引用。 Not sure if it matters but I was working on ane xpo project prior to this but it shouldn't be affecting this separate project I'm working on, will it?不确定这是否重要,但在此之前我正在从事一个 xpo 项目,但它不应该影响我正在从事的这个单独的项目,对吗?

I'm not sure how to fix this, I have tried clearing watchman watches, deleting node_modules and reset metro's cache.我不知道如何解决这个问题,我尝试清除守望者手表,删除 node_modules 并重置 Metro 的缓存。

npm start --reset-cache did not work but npm start -- --reset-cache fixed my issue. npm start --reset-cache不起作用,但npm start -- --reset-cache解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入'react-native-vector-icon' 结果'无法解析模块'@expo/vector-icons' 错误 - Importing 'react-native-vector-icon' results 'Unable to resolve module '@expo/vector-icons' error 无法解析模块`@expo/vector-icons/FontAwesome` - Unable to resolve module `@expo/vector-icons/FontAwesome` from BottomNavigation在React Native中不显示@ expo / vector-icons - BottomNavigation does not show @expo/vector-icons in React Native 反应本机! @expo/vector-icons/Fontisno 的问题 - React-native! Problem with @expo/vector-icons/Fontisno 如何在本机应用程序中添加@expo/vector-icons? - how to add @expo/vector-icons in react native app? Native-React + Expo:无法从“src/boot/setup.js”解析“@expo/vector-icons/fonts/Ionicons.ttf” - Native-React + Expo: Unable to resolve "@expo/vector-icons/fonts/Ionicons.ttf" from "src/boot/setup.js" 无法解析模块`@expo/vector-icons` - unable to resolve module `@expo/vector-icons` react-native-vector-icons 或 @expo/vector-icons 未在 Android 设备上呈现 - react-native-vector-icons or @expo/vector-icons not rendering on android device 反应原生矢量图标/fontawesome 未在 expo cli 中显示图标 - react native vector icons/fontawesome not showing icons in expo cli vector-icons/FontAwesome5 在 react-native 上显示错误的图标 - vector-icons/FontAwesome5 showing wrong icon on react-native
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM