我正面临着以下问题。
Error: Unable to resolve module `react-native-vector-icons/AntDesign` from `node_modules/react-native-elements/src/helpers/getIconType.js`: react-native-vector-icons/AntDesign could not be found within the project.Package.json
{
"name": "GeoLocation",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/geolocation": "^2.0.2",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-elements": "^1.2.7",
"react-native-fused-location": "^1.1.1",
"react-native-get-location": "^1.4.2",
"react-native-vector-icons": "^4.6.0"
},
"devDependencies": {
"@babel/core": "7.8.4",
"@babel/runtime": "7.8.4",
"@react-native-community/eslint-config": "0.0.5",
"babel-jest": "24.9.0",
"eslint": "6.8.0",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.56.4",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}我已经完成了以下链接中提到的所有步骤。
Unable to resolve module 'react-native-vector-icons/AntDesign''
发布于 2020-02-27 17:42:13
我已经看过你的代码,我想告诉你,首先你应该编辑你的package.json并将react-native-vector-icons版本"react-native-vector-icons": "^4.6.0",升级到"react-native-vector-icons": "^6.6.0",,然后删除你的节点模块文件夹,然后运行npm安装命令,然后在你的文件中导入矢量图标,如下所示:-
import AntDesign from "react-native-vector-icons/AntDesign"如果你仍然面临任何问题,请随时再问一次。
https://stackoverflow.com/questions/60429130
复制相似问题