Welcome to the Treehouse Community
Looking to learn something new?
martin cartledge1,933 Points
Error Deploying React App on Heroku...
I set up my React app and now I am ready to deploy. I've followed the steps provided to simply host on Heroku but, I'm hitting errors when I
git push heroku master.
Here's my terminal printout:
remote: =====> Downloading Buildpack: https://github.com/mars/create-react-app-inner-buildpack.git remote: =====> Detected Framework: React.js (create-react-app) remote: Using existing `static.json` remote: Enabling runtime environment variables remote: remote: > Portfolio@0.1.0 build /tmp/build_941045d52a01bfc1698a689e5b44c6ac remote: > node scripts/build.js webpack remote: remote: Creating an optimized production build... remote: Failed to compile. remote: remote: Module not found: Error: Cannot resolve module 'react-router' in /tmp/build_941045d52a01bfc1698a689e5b44c6ac/src remote: remote: remote: npm ERR! Linux 3.13.0-105-generic remote: npm ERR! argv "/tmp/build_941045d52a01bfc1698a689e5b44c6ac/.heroku/node/bin/node" "/tmp/build_941045d52a01bfc1698a689e5b44c6ac/.heroku/node/bin/npm" "run" "build" remote: npm ERR! node v6.9.1 remote: npm ERR! npm v3.10.8 remote: npm ERR! code ELIFECYCLE remote: npm ERR! Portfolio@0.1.0 build: `node scripts/build.js webpack` remote: npm ERR! Exit status 1 remote: npm ERR! remote: npm ERR! Failed at the Portfolio@0.1.0 build script 'node scripts/build.js webpack'. remote: npm ERR! Make sure you have the latest version of node.js and npm installed. remote: npm ERR! If you do, this is most likely a problem with the Portfolio package, remote: npm ERR! not with npm itself. remote: npm ERR! Tell the author that this fails on your system remote: npm ERR! node scripts/build.js webpack remote: npm ERR! You can get information on how to open an issue for this project with: remote: npm ERR! npm bugs Portfolio remote: npm ERR! Or if that isn't available, you can get their info via: remote: npm ERR! npm owner ls Portfolio remote: npm ERR! There is likely additional logging output above. remote: remote: npm ERR! Please include the following file with any support request: remote: npm ERR! /tmp/build_941045d52a01bfc1698a689e5b44c6ac/npm-debug.log remote: ! Push rejected, failed to compile React.js (create-react-app) multi app. remote: remote: ! Push failed remote: Verifying deploy.... remote: remote: ! Push rejected to ancient-temple-10539. remote: To https://git.heroku.com/ancient-temple-10539.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/ancient-temple-10539.git'
Seth Kroger56,403 Points
Did you remember to use
--save when you installed react-router so it would be added to your package.json file?