gpt4 book ai didi

reactjs - 找不到模块 : Error: Can't resolve '@material-ui/core/styles' (when deploying to heroku)

转载 作者:行者123 更新时间:2023-12-03 19:46:12 31 4
gpt4 key购买 nike

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

Module not found: Error: Can't resolve '@material-ui/core/styles'



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

这是完整的错误日志文件

-----> Build succeeded! =====> Downloading Buildpack: https://github.com/mars/create-react-app-inner-buildpack.git =====> Detected Framework: React.js (create-react-app) Writing static.json to support create-react-app Enabling runtime environment variables amusement-parks-europe@0.1.0 build /tmp/build_a49639db14111a3c4e29b2f3e9e25c49 react-scripts build Creating an optimized production build... Failed to compile. Module not found: Error: Can't resolve '@material-ui/core/styles' in '/tmp/build_a49639db14111a3c4e29b2f3e9e25c49/src' npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! amusement-parks-europe@0.1.0 build: react-scripts build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the amusement-parks-europe@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /app/.npm/_logs/2018-10-08T20_29_28_807Z-debug.log ! Push rejected, failed to compile React.js (create-react-app) multi app. ! Push failed



该项目可以在github上找到
react app using google Api

感谢您的帮助,我尝试了很多想法并没有解决。

最佳答案

问题已根据@samokasha 的回答解决,
解决方案正在使用npm install @material-ui/core --save
我之前使用过相同的命令,但我错过了 --save
谢谢您的帮助。

关于reactjs - 找不到模块 : Error: Can't resolve '@material-ui/core/styles' (when deploying to heroku),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52820236/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com