找不到package.json中的模块

时间:2018-04-12 08:06:09

标签: reactjs yarnpkg

我目前有一个只导入React的文件,以及来自react-conversation-form的对话:

import React from 'react';
import Conversation from 'react-conversation-form';

我的package.json看起来像这样:

{
  "dependencies": {
    "@rails/webpacker": "^3.2.2",
    "babel-preset-react": "^6.24.1",
    "prop-types": "^15.6.0",
    "react": "^16.2.0",
    "react-conversation-form": "^2.0.1",
    "react-dom": "^16.2.0"
  },
  "devDependencies": {
    "babel-core": "^6.26.0",
    "webpack-dev-server": "^2.11.2"
  }
}

尽管如此,我收到Cannot find module "react-conversation-form"错误。有没有办法调试这个?

2 个答案:

答案 0 :(得分:1)

您可以执行以下操作:yarn cache clean

然后执行:yarn install

答案 1 :(得分:0)

看起来很好。您是否有可能错过执行“npm install”或由于某种原因失败?