Reputation: 1
I'm trying to deploy a react app I worked on and when I try to push to heroku master it says "failed to compile node.js". Now I've already tried to specify what node I'm using by following the steps, but still getting an error.
Here is what I'm getting in the terminal:
Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./src/pages/Home/Home.js
remote: Cannot find file '../../Components/Intro' in './src/pages/Home'.
remote:
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! [email protected] build: react-scripts build
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_080Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! [email protected] build: cd client && npm run build
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_461Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! [email protected] heroku-postbuild: npm run build
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_568Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Upvotes: 0
Views: 421
Reputation: 703
It might have to do with .gitignore file. Make sure /Componentes/Intro is not added in .gitignore file
Upvotes: 0
Reputation: 36
Try to create a server using Express.js https://medium.com/better-programming/how-to-deploy-your-react-app-to-heroku-aedc28b218ae
Upvotes: 0