找不到模块:错误:无法解析“@material-ui/core/styles”(部署到heroku时)

2024-03-13

我有一个 React 应用程序并尝试将其部署到 Heroku 并在运行时git push heroku master

找不到模块:错误:无法解析“@material-ui/core/styles”

我搜索了类似的问题并安装了最新版本的npm、node和material-ui 我也尝试过npm install @material-ui/core..没用。

这是完整的错误日志文件

-----> 构建成功! =====> 下载构建包:https://github.com/mars/create-react-app-inner-buildpack.git https://github.com/mars/create-react-app-inner-buildpack.git=====> 检测到的框架:React.js (create-react-app) 写作static.json支持 create-react-app 启用运行时环境变量[电子邮件受保护] /cdn-cgi/l/email-protection构建/tmp/build_a49639db14111a3c4e29b2f3e9e25c49 反应脚本构建 创建优化的生产构建... 编译失败。 找不到模块:错误:无法解析“/tmp/build_a49639db14111a3c4e29b2f3e9e25c49/src”中的“@material-ui/core/styles” npm 错误!代码 生命周期 npm 错误!错误号1 npm 错误![电子邮件受保护] /cdn-cgi/l/email-protection build: react-scripts buildnpm 错误!退出状态1 npm 错误! npm 错误!失败于[电子邮件受保护] /cdn-cgi/l/email-protection构建脚本。 npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。 npm 错误!此运行的完整日志可以在以下位置找到: npm 错误! /app/.npm/_logs/2018-10-08T20_29_28_807Z-debug.log !推送被拒绝,无法编译 React.js (create-react-app) 多应用程序。 !推送失败

并且该项目可以在github上找到使用 google Api 反应应用程序 https://github.com/MaherAbedah/Top_10_amusement_parks

感谢您的帮助,我尝试了很多想法但没有找到解决方案。


根据@samokasha的回答,问题已解决, 该解决方案正在使用npm install @material-ui/core --save

我之前使用过相同的命令,但我错过了--save

谢谢您的帮助。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

找不到模块:错误:无法解析“@material-ui/core/styles”(部署到heroku时) 的相关文章

随机推荐