Cant deploy my site to heroku. please help

I have coded a reactjs app with nodeJSExpress as backend.
The backend and front-end has the same root folder.
I run react on localhost:3000
and
nodejs on localhost:3001

I use route and a proxy in package.json so
fetch localhost/3000/api
and
localhost/3001/api
will get me the same thing.

I have connected my github acc to heroku to do the deploy thing automatic. This is what I get:

/src/index.js

`
Cannot find module: ‘core-js/es6/map’. Make sure this package is installed.

   You can install this package by running: npm install core-js/es6/map.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.1.0 build: react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@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! /tmp/npmcache.y50iu/_logs/2019-04-09T21_38_15_149Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.1.0 heroku-postbuild: npm install && npm install --only=dev --no-shrinkwrap && npm run build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@0.1.0 heroku-postbuild 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! /tmp/npmcache.y50iu/_logs/2019-04-09T21_38_15_161Z-debug.log
-----> Build failed

Push rejected, failed to compile Node.js app.`

It does work local with heroku local -p 3000/3001 but I have to run that command first in reactapp and then in the api folder(obv) just as I am always doing. I just wonder if this is really possible to deploy on heroku?

PS I am very new to coding and hosting so i have no idea what I am doing. I did follow some guides to deopoy this but I couldnt make it work

I solved it by seperating express and react. the deployment of react to heroku went good and so did aldo the express but when trying to access the express url, this shows up on the webpage:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail

and when doing heroku logs --tail I get

 »   Error: Missing required flag:
 »     -a, --app APP  app to run command against
 »   See more help with --help

does anytone know where I should put the -a flag?

Okay, i figured how to get the error log lmao

Function.Module._load (internal/modules/cjs/loader.js:508:25)
‘’ at Module.require (internal/modules/cjs/loader.js:637:17)
require (internal/modules/cjs/helpers.js:22:18)
Object. (/app/api.js:3:15)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)
Module.load (internal/modules/cjs/loader.js:600:32)
tryModuleLoad (internal/modules/cjs/loader.js:539:12)
Function.Module._load (internal/modules/cjs/loader.js:531:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api@0.0.0 start: npm install && node api.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api@0.0.0 start 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/2019-04-10T16_51_15_066Z-debug.log
Process exited with status 1
Starting process with command npm start

api@0.0.0 start /app
npm install && node api.js

State changed from starting to crashed
audited 220 packages in 1.586s
found 3 low severity vulnerabilities
run npm audit fix to fix them, or npm audit for details
internal/modules/cjs/loader.js:584
throw err;
^

Error: Cannot find module ‘mysql’
Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
Function.Module._load (internal/modules/cjs/loader.js:508:25)
Module.require (internal/modules/cjs/loader.js:637:17)
require (internal/modules/cjs/helpers.js:22:18)
Object. (/app/api.js:3:15)
Module._compile (internal/modules/cjs/loader.js:701:30)
Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)
Module.load (internal/modules/cjs/loader.js:600:32)
tryModuleLoad (internal/modules/cjs/loader.js:539:12)
Function.Module._load (internal/modules/cjs/loader.js:531:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api@0.0.0 start: npm install && node api.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api@0.0.0 start 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/2019-04-10T16_51_21_429Z-debug.log
Process exited with status 1
at=error code=H10 desc=“App crashed” method=GET path=“/” host=expressbacken.herokuapp.com request_id=114ddff2-7804-497b-9d38-b7937073f646 fwd=“80.217.154.157” dyno= connect= service= status=503 bytes= protocol=https
at=error code=H10 desc=“App crashed” method=GET path=“/favicon.ico” host=expressbacken.herokuapp.com request_id=cc7b9782-785d-4b36-a20e-fa29891a6b1c fwd=“80.217.154.157” dyno= connect= service= status=503 bytes= protocol=https
Build started by user
Deploy e774f1e2 by user
Release v16 created by user
Build succeeded
State changed from crashed to starting
Starting process with command npm start

api@0.0.0 start /app
npm install && node api.js

State changed from starting to crashed
audited 220 packages in 1.307s
found 3 low severity vulnerabilities
run npm audit fix to fix them, or npm audit for details
/app/api.js:11
server.listen(server_port, server_host, function() {
^

ReferenceError: server is not defined
at Object. (/app/api.js:11:1)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api@0.0.0 start: npm install && node api.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api@0.0.0 start 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:
2npm ERR! /app/.npm/_logs/2019-04-10T16_53_49_853Z-debug.log
Process exited with status 1
at=error code=H10 desc=“App crashed” method=GET path=“/favicon.ico” host=expressbacken.herokuapp.com request_id=8f77fc03-82a5-40f6-9e7b-14aea473132c fwd=“80.217.154.157” dyno= connect= service= status=503 bytes= protocol=https
at=error code=H10 desc=“App crashed” method=GET path=“/” host=expressbacken.herokuapp.com request_id=b9920cd5-724e-4121-a788-6c7010f1ce09 fwd=“80.217.154.157” dyno= connect= service= status=503 bytes= protocol=https
at=error code=H10 desc=“App crashed” method=GET path=“/” host=expressbacken.herokuapp.com request_id=3f016e6f-6888-4597-b4e6-c8cd9de58467 fwd=“80.217.154.157” dyno= connect= service= status=503 bytes= protocol=https
at=error code=H10 desc=“App crashed” method=GET path=“/favicon.ico” host=expressbacken.herokuapp.com request_id=5cf33887-4c98-4f55-9387-a123213421f8 fwd=“80.217.154.157” dyno= connect= service= status=503 bytes= protocol=https