错误:捆绑失败:错误:无法解析模块`react-native-vector-icons/Feather`

Muh*_*faq 7 javascript npm reactjs react-native react-native-android

在 React Native 中,我只是应用了React Native 库中的Flatlist。成功安装所有库

包.json

  "dependencies": {
    "feather-icons-react": "^0.3.0",
    "react": "16.6.3",
    "react-native": "0.57.8",
    "react-native-elements": "^1.0.0-beta7",
    "react-native-vector-icons": "^4.2.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.51.0",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }
}
Run Code Online (Sandbox Code Playgroud)

应用程序.js

import React, {Component} from 'react';
import Main from './components/MainComponents';

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (

        <Main />

    );
  }
}
Run Code Online (Sandbox Code Playgroud)

错误日志

    error: bundling failed: Error: Unable to resolve module `react-native-vector-icons/Feather` from `F:\React Native\FirstProject\node_modules\react-native-elements\src\helpers\getIconType.js`: Module `react-native-vector-icons/Feather` does not exist in the Haste module map
Run Code Online (Sandbox Code Playgroud)

新手反应原生

帮助将不胜感激

谢谢

Vin*_*our 8

要安装 react-native-vector-icons,您需要安装它,然后链接它。第一次运行:
npm install react-native-vector-icons --save
或者如果你使用纱线
yarn add react-native-vector-icons

然后,您必须像这样链接它:
react-native link react-native-vector-icons