【问题标题】:"No default language could be detected for this app" while using multiple Buildpacks for an app on Heroku在 Heroku 上为应用程序使用多个 Buildpack 时,“无法检测到此应用程序的默认语言”
【发布时间】:2017-05-16 23:08:45
【问题描述】:

我将两个 nodejs 项目部署到 Heroku,每个项目都在自己的文件夹中 -
NodejsExpressApp1NodejsConsoleApp1

我已将Procfile 文件添加到应用根目录,其中包含以下内容 -
web: node NodejsExpressApp1/app.js
worker: node NodejsConsoleApp1/app.js

我还将BUILD_DIR 配置变量设置为NodejsExpressApp1 文件夹。

本地一切正常。

下面显示了我在部署时得到的结果 -

c:\ExpressMultiProjectApp2>git push heroku master
Counting objects: 1506, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1401/1401), done.
Writing objects: 100% (1506/1506), 4.85 MiB | 92.00 KiB/s, done.
Total 1506 (delta 269), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     No default language could be detected for this app.
remote:                         HINT: This occurs when Heroku cannot detect     the buildpack to use for this application automatically.
remote:                         See     https://devcenter.heroku.com/articles/buildpacks
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to sheltered-mesa-74202.
remote:
To https://git.heroku.com/sheltered-mesa-74202.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sheltered-mesa-74202.git'`

谢谢!

【问题讨论】:

    标签: node.js heroku typescript buildpack procfile


    【解决方案1】:

    在应用根目录中创建 package.json 文件后,该问题已修复 -

    {
        "name": "nodejs-express-app1",
        "version": "0.0.0",
        "description": "Multiple Buildpacks App",
        "author": { "name": "SimonBor" },
        "dependencies": {
            "express": "~4.9.0"
        }
    }
    

    设置变量BUILD_DIR不是必须的步骤。

    当然,这不是最佳实践解决方案,但它让我能够继续开发。
    如果有更好的解决方案,我会更加高兴。

    最好的问候!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-07
      • 2017-10-29
      • 2017-02-13
      • 2021-01-23
      • 1970-01-01
      • 2010-09-08
      • 2021-11-12
      相关资源
      最近更新 更多