【发布时间】:2019-04-29 05:06:05
【问题描述】:
我正在使用 create-react-app 和 react-bootstrap,当我运行 npm start 时出现此错误:
编译失败../node_modules/@restart/context/forwardRef.js
找不到模块:无法解析“C:\Users...\node_modules@restart\context”中的“react”
此错误发生在构建期间,无法消除。
我已经尝试删除 package-lock.json 并再次运行 npm install 但没有帮助。
【问题讨论】:
-
检查 ./node_modules 文件夹中是否存在“react”包。还要完全删除 node_modules。 node_modules 将再次生成。希望这会有所帮助。
-
this的可能重复
-
也许你需要做一个
npm install? -
删除
node_modules,运行npm cache clean并再次运行npm install。
标签: reactjs create-react-app react-bootstrap