[英]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.