简体   繁体   English

如何将 nodejs 和 vuejs 部署到 heroku

[英]How to deploy nodejs and vuejs to heroku

How can I can deploy my project to heroku.如何将我的项目部署到 heroku。 My code base here:我的代码库在这里: 图片


I try to deploy to heroku but I always get an error.我尝试部署到 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

Can I change a heroku config to uses package file in sub folder?我可以更改 heroku 配置以使用子文件夹中的包文件吗?

Please restructure your app, Heroku identity app by its app structure.请根据其应用程序结构重构您的应用程序 Heroku 身份应用程序。
In your root directory there is not package.json file在您的root目录中没有package.json文件
Its best if you deploy back-end and front-end as separate apps最好将back-endfront-end部署为单独的应用程序

Hope this will help you.希望这会帮助你。 Happy Coding.快乐编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM