簡體   English   中英

無法在heroku上推送node.js應用程序

[英]unable to push node.js app on heroku

我嘗試在 heroku 上推送我的 node.js 應用程序,但是。 無法檢測到此應用的默認語言。 我什至嘗試過 heroku buildpacks:set heroku/nodejs。 但是還是推不動。

 Counting objects: 31, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (24/24), done.
    Writing objects: 100% (31/31), 5.37 KiB | 0 bytes/s, done.
    Total 31 (delta 3), 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 radiant-cliffs-91678.
    remote: 
    To https://git.heroku.com/radiant-cliffs-91678.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/radiant-cliffs-91678.git'

根據您的日志,Heroku 似乎無法檢測您的應用程序的語言。

對於 Node.js,您需要在項目的根目錄中創建一個package.json文件(使用類似npm init東西),或者您可以在項目的根目錄中創建一個Procfile來指定您的語言:

web: node index.js

轉到命令行並運行以下命令:

heroku buildpacks:set -a app_name heroku/node

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM