【问题标题】:How to deploy nodejs and vuejs to heroku如何将nodejs和vuejs部署到heroku
【发布时间】:2019-08-23 07:45:17
【问题描述】:

如何将我的项目部署到 heroku。 我的代码库在这里:


我尝试部署到 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 配置以使用子文件夹中的包文件吗?

【问题讨论】:

  • package.json 文件需要在根文件上然后heroku 才能理解这是nodejs 项目
  • 尝试点击此链接medium.com/netscape/… 并更改应用结构
  • @RaiTalhaRehmanKhan 那么,我应该改变我的项目结构吗?对吗?
  • 是的,改变结构

标签: node.js vue.js heroku deployment


【解决方案1】:

请根据其应用结构重组您的应用,Heroku 身份应用。
在您的root 目录中没有package.json 文件
最好将back-endfront-end 部署为单独的应用程序

希望这会对您有所帮助。快乐编码。

【讨论】:

    猜你喜欢
    • 2018-02-17
    • 2012-08-10
    • 2017-01-04
    • 1970-01-01
    • 2018-03-26
    • 2017-11-06
    • 2023-04-09
    • 2016-06-27
    • 2021-10-15
    相关资源
    最近更新 更多