“反应原生元素”有什么问题?

Ele*_*sar 1 react-native react-native-elements

当我尝试在我的代码中使用 'react-native-elements' 包时,我遇到了这个错误:

捆绑失败:错误:无法react-native-vector-icons/FontAwesomenode_modules\react-native-elements\src\social\SocialIcon.js以下位置解析模块:在项目中找不到 react-native-vector-icons/FontAwesome。

我已经做了很多事情来修复它。我再次安装了“react-native-vector-icons”,我使用了“rm ./node_modules/react-native/local-cli/core/fixtures/files/package.json”,但它们都不起作用。我该怎么做才能克服这个问题?我真的很感谢你们的帮助。

Mr.*_*iya 7

确保您已经使用npm install react-native-vector-icons安装了该软件包 并将其链接

react-native 链接 react-native-vector-icons

然后对于 ios,您需要安装 pod(转到终端上的项目 ios 文件夹并输入命令pod install

然后使用 react-native start --reset-cache 重置打包器缓存