我正在尝试在本机0.55.4中安装react-native-vector-icons版本6.0.1,但是每当我尝试在应用程序错误中使用矢量图标语法和图标时,都会出现错误。我想使用真棒字体5图标。我应该使用哪个版本的react native安装这些图标。还有其他我可以使用的库。
Metro Bundler ready.
Loading dependency graph, done.
error: bundling failed: Error: Couldn't find preset "module:metro-react-native-babel-preset" relative to directory "E:\\RN\\newproject\\node_modules\\react-native-vector-icons"
at E:\RN\newproject\node_modules\babel-core\lib\transformation\file\options\option-manager.js:293:19
at Array.map (<anonymous>)
at OptionManager.resolvePresets (E:\RN\newproject\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
at OptionManager.mergePresets (E:\RN\newproject\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
at OptionManager.mergeOptions (E:\RN\newproject\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
at OptionManager.init (E:\RN\newproject\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at File.initOptions (E:\RN\newproject\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (E:\RN\newproject\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (E:\RN\newproject\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
BUNDLE [android, dev] ./index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 98.8% (479/482), failed.
我的package.json
{
"name": "newproject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-vector-icons": "^5.0.0"
},
"devDependencies": {
"babel-jest": "23.6.0",
"babel-preset-react-native": "4.0.1",
"jest": "23.6.0",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native"
}
}