Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found: Error: Can't resolve '@material-ui/core/styles' (when deploying to heroku)

Tags:

reactjs

heroku

i have a react application and trying to deploy it to Heroku and when runnung git push heroku master

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

I searched for similar issues and installed the latest versions of npm, node and metarial-ui also i tried npm install @material-ui/core ..didn't work.

here is the full error-log file

-----> 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 [email protected] 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! [email protected] build: react-scripts build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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

and the project can be found on github react app using google Api

thanks for any help, I tried many ideas and came to no solution .

like image 594
maher abedah Avatar asked Oct 15 '18 15:10

maher abedah


1 Answers

the problem was solved according to the answer from @samokasha , the solution was using npm install @material-ui/core --save

I used the same command before but I missed the --save

thanks for the help.

like image 120
maher abedah Avatar answered Nov 02 '22 14:11

maher abedah