简体   繁体   English

部署到 Heroku 时未找到 Buildpack

[英]No Buildpack found while deploying to Heroku

文件树

This is my file tree containing a folder for my Vue app (client folder) and my NodeJS server (server folder).这是我的文件树,其中包含我的 Vue 应用程序(客户端文件夹)和我的 NodeJS 服务器(服务器文件夹)的文件夹。

When I try uploading to Heroku, I get an error saying that no matching buildpacks could be found , and that's I believe due to my source folder not having a package.js and that being because I have one in the client and server folders.当我尝试上传到 Heroku 时,我收到一条错误消息,说no matching buildpacks could be found ,我相信这是因为我的source folder没有package.js ,因为我在clientserver文件夹中有一个。

So how can I accomplish deploying both my client and server-side in one Heroku app, or would I need to split my whole app in one Heroku Front-End App and one Heroku Back-End App?那么我如何才能在一个 Heroku 应用程序中完成我的客户端和服务器端的部署,或者我是否需要将我的整个应用程序拆分为一个 Heroku 前端应用程序和一个 Heroku 后端应用程序?

I'm sorry for such a stupid question, but I am really confused on how to put my app live, since it's finally finished after a month of work.我很抱歉提出这样一个愚蠢的问题,但我真的很困惑如何让我的应用程序上线,因为它在一个月的工作后终于完成了。

No Buildpack found while deploying to Heroku .. When I try uploading to Heroku, I get an error saying that no matching buildpacks could be found, and that's I believe due to my source folder not having a package.js部署到 Heroku 时没有找到 Buildpack .. 当我尝试上传到 Heroku 时,我收到一条错误消息,说找不到匹配的 buildpack,我相信这是因为我的源文件夹没有 package.js

Correct, this error "no buildpack found" happens because Heroku looks at (only) your root directory and cannot determine what language/framework you are using.正确,发生此错误“未找到 buildpack”是因为 Heroku 查看(仅)您的根目录而无法确定您使用的语言/框架。

The package.json file defines the dependencies that should be installed with your application. package.json 文件定义了应与您的应用程序一起安装的依赖项。 To create a package.json file for your app, run the command npm init in the root directory of your app.要为您的应用程序创建 package.json 文件,请在应用程序的根目录中运行命令 npm init。 https://devcenter.heroku.com/articles/deploying-nodejs#declare-app-dependencies https://devcenter.heroku.com/articles/deploying-nodejs#declare-app-dependencies

I'd recommend reading the heroku node docs and deploying a "hello world" application first, as a learning experience.作为学习经验,我建议先阅读heroku 节点文档并部署“hello world”应用程序。 You'll also want to read about the Procfile .您还需要阅读有关Procfile 的信息

Deploying a client-server application to Heroku is quite common, all apps work this way (a single deploy).将客户端-服务器应用程序部署到 Heroku 非常普遍,所有应用程序都以这种方式工作(单个部署)。 But, for node apps, there are many different ways to deploy, and there is no official (documented) way to organize your code, AFAIK.但是,对于节点应用程序,有许多不同的部署方式,并且没有官方(记录)的方式来组织您的代码,AFAIK。

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

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