2

How can I can deploy my project to heroku. My code base here: img


I try to deploy to heroku but I always get an error.

-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz

 !     ERROR: Application not supported by 'heroku/nodejs' buildpack
 !     
 !     The 'heroku/nodejs' buildpack is set on this application, but was
 !     unable to detect a Node.js codebase.
 !         
 !     A Node.js app on Heroku requires a 'package.json' at the root of
 !     the directory structure.
 !     
 !     If you are trying to deploy a Node.js application, ensure that this
 !     file is present at the top level directory. This directory has the
 !     following files:
 !     
 !     Procfile
 !     server/
 !     tsconfig.json
 !     vue/
 !         
 !     If you are trying to deploy an application written in another
 !     language, you need to change the list of buildpacks set on your
 !     Heroku app using the 'heroku buildpacks' command.
 !         
 !     For more information, refer to the following documentation:
 !     https://devcenter.heroku.com/articles/buildpacks
 !     https://devcenter.heroku.com/articles/nodejs-support#activation
       More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
 !     Push failed

Can I change a heroku config to uses package file in sub folder?

4
  • package.json file need to be on root file then heroku can understand this is nodejs project Commented Apr 2, 2019 at 4:50
  • try to follow this link medium.com/netscape/… and change the app structure Commented Apr 2, 2019 at 4:53
  • @RaiTalhaRehmanKhan So, should I change my project structure. Right? Commented Apr 2, 2019 at 4:54
  • yes change the structure Commented Apr 2, 2019 at 5:02

1 Answer 1

1

Please restructure your app, Heroku identity app by its app structure.
In your root directory there is not package.json file
Its best if you deploy back-end and front-end as separate apps

Hope this will help you. Happy Coding.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.