How to deploy existing app to HEROKU?

Hello everyone.

I got the main source file form developer who had previously hosted our webapp on his account, but due to cost management, we decided to deploy from our company\`s account.

He provided all the source code. and it contains following folders/files.

.git ,dist, node\_modules, public, src. .DS\_Store, babel.config, package, package-lock, README,server , vue.config.

Then I am getting the error when trying to deploy the this app to heroku.

It works locally when doing npm start, but gives error when deoplying to heroku.

These are the following steps I did

\-Create new app on HEROKU,

$ heroku login

$ cd my-project/

$ git init (this gives message “Initialized empty Git repository in D:/Others/{appname}/.git/”

$ heroku git:remote -a {appname}, doing this gives me error

” detected dubious ownership in repository at ‘D:/Others/{appname}”

Ingoring above errors and proceeding with following command

$ git add .

$ git commit -am “first”

$ git push heroku master

Then it gives me error after pushing

`-> 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`](https://devcenter.heroku.com/articles/troubleshooting-node-deploys)

`remote:`

`remote: Some possible problems:`

`remote:`

`remote: – Node version not specified in package.json`

`remote:` [`https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version`](https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version)

`remote:`

`remote: Love,`

`remote: Heroku`

`remote:`

`remote: ! Push rejected, failed to compile Node.js app.`

`remote:`

`remote: ! Push failed`

`remote: Verifying deploy…`

`remote:`

`remote: ! Push rejected to {appname}`

`remote:`

​

`! [remote rejected] master -> master (pre-receive hook declined)`

`error: failed to push some refs to`



View Reddit by Run_the_showView Source

our recommended web hosting companies

NameCheap

website link: namecheap.pxf.io/Alaaeldin.medium

Hostinger

website link: https://hostinger.sjv.io/Jr95Qr

InMotion hosting

website link: partners.inmotionhosting.com/XxJ0Jg

Hubspot

website link: hubspot.sjv.io/DV2O35

Leave a Comment

Your email address will not be published. Required fields are marked *