I have a few small react web apps I have made that I am trying to deploy to heroku. I found this https://github.com/mars/create-react-app-buildpack through a youTube video and supposedly this is/was a simple method for deployment. There are several steps the author lists (first two don't apply):
- git init
- heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git
- git add .
- git commit -m "Start with create-react-app"
- git push heroku master
- heroku open
Once I get to the git push heroku master I get an error in console that says:
npm ERR! missing script: build
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /app/.npm/_logs/2018-03-26T16_55_19_748Z-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 my-simple-react-weather-app.
remote:
To https://git.heroku.com/my-simple-react-weather-app.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/my-simple-react-weather-app.git'
I did some searching and found a few build scripts for my package.json file but none of them seem to work (""build": " webpack --config webpack.conf.js"")
Here is my package.json:
{
"name": "redux-simple-starter",
"version": "1.0.0",
"description": "Simple React YouTube App",
"main": "index.js",
"scripts": {
"start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive ./test",
"test:watch": "npm run test -- --watch"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"chai": "^3.5.0",
"chai-jquery": "^2.0.0",
"jquery": "^2.2.1",
"jsdom": "^8.1.0",
"mocha": "^2.4.5",
"react-addons-test-utils": "^0.14.7",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
"babel-preset-stage-1": "^6.1.18",
"lodash": "^3.10.1",
"react": "^0.14.3",
"react-dom": "^0.14.3",
"react-redux": "4.3.0",
"react-router": "^2.0.1",
"redux": "^3.0.4",
"youtube-api-search": "0.0.5"
}
}
Can anyone help me out here? I am logged into my heroku account already. Is there a simpler way than what I am doing here?