Problem:

我正在使用expo-cli使用react-simple-chatbot创建一个应用程序 . 这就是我的组件的外观 .

import React, { PureComponent } from "react";
import ChatBot from "react-simple-chatbot";

class Trafficbot extends PureComponent {
  static navigationOptions = {
    title: "Trafficbot",
    headerStyle: {
      backgroundColor: "#06153b"
    },
    headerTintColor: "#fff",
    headerTitleStyle: {
      color: "#ffff"
    }
  };

  render() {
    return (
      <ChatBot
        headerTitle="Speech Recognition"
        recognitionEnable={true}
        steps={[
          {
            id: "1",
            message: "What is your name?",
            trigger: "2"
          },
          {
            id: "2",
            user: true,
            trigger: "3"
          },
          {
            id: "3",
            message: "Hi {previousValue}, nice to meet you!",
            end: true
          }
        ]}
      />
    );
  }
}

export default Trafficbot;

但是当我运行应用程序时,它会给我一个这样的错误 .

ERROR
15:44
Unable to resolve "styled-components" from "node_modules\react-simple-chatbot\dist\react-simple-chatbot.js"
ERROR
15:44
Building JavaScript bundle: error

我寻找解决方案 . 然后我能够找到一个安装样式化组件依赖项的解决方案 . 然后它向我显示错误说明关键帧中的问题 . 有人可以帮我解决这个问题吗?谢谢! .