如何将nodejs和vuejs部署到heroku

问题描述 投票:1回答:1

如何将项目部署到heroku。我的代码基于:img

我尝试部署到heroku但我总是得到一个错误。

-----> 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

我可以更改heroku配置以使用子文件夹中的包文件吗?

node.js vue.js heroku deployment
1个回答
1
投票

请通过其应用程序结构重构您的应用程序,Heroku身份应用程序。 在你的root目录中没有package.json文件 如果您将back-endfront-end部署为单独的应用程序,那就最好了

希望这会帮助你。快乐的编码。

© www.soinside.com 2019 - 2024. All rights reserved.