【问题标题】:react-geosuggest issue Module not found: Error: Can't resolve 'prop-types'react-geosuggest 问题模块未找到:错误:无法解析“prop-types”
【发布时间】:2018-07-04 04:03:17
【问题描述】:

在使用 webpack 时,我无法在 Azure 上发布我的应用程序。 在服务器上运行时会抛出以下错误。

ERROR in ./node_modules/react-geosuggest/module/prop-types.js
Module not found: Error: Can't resolve 'prop-types' in 'd:\a\1\s\some\project\node_modules\react-geosuggest\module'
 @ ./node_modules/react-geosuggest/module/prop-types.js 7:17-38
 @ ./node_modules/react-geosuggest/module/Geosuggest.js
 @ multi moment react-geosuggest react-bootstrap react-overlays ./Scripts/React/Components/Oem

而且我不知道/不知道到底是什么问题。

另一方面 - 在本地 - 它正在运行/构建没有任何问题。所以我真的被困在这一点上。

这是我的依赖项(package.json)的样子:

"dependencies": {
    "bootstrap": "3.3.7",
    "classnames": "^2.2.5",
    "moment": "^2.19.2",
    "react": "15.6.1",
    "react-addons-css-transition-group": "^15.6.0",
    "react-addons-transition-group": "^15.6.0",
    "react-dom": "15.6.1",
    "react-bootstrap": "0.31.5",
    "react-geosuggest": "2.7.0",
    "webpack": "^3.6.0",
    "pathval": "1.1.0"
}

在我使用 react-geosuggest 的另一个项目中,它正在工作/构建,没有任何抱怨。

我已经尝试使用最新版本的react & react-dom 以及添加prop-types。但还是同样的问题。

【问题讨论】:

    标签: node.js reactjs typescript node-modules


    【解决方案1】:

    我遇到了类似的问题,并通过将其添加到 package.json 中的依赖项部分来解决它:

    "prop-types": "^15.6.1"
    

    接着重新运行:

    yarn install
    

    【讨论】:

      猜你喜欢
      • 2017-05-22
      • 2020-11-15
      • 2017-11-11
      • 2017-01-17
      • 2020-11-01
      • 1970-01-01
      • 2019-04-08
      • 2017-03-22
      • 2018-09-21
      相关资源
      最近更新 更多