2016-09-22 87 views
1

我嘗試在heroku上推送我的node.js應用程序。這個應用程序沒有檢測到默認語言。我甚至嘗試過heroku buildpack:設置heroku/nodejs。但仍然無法推動。無法在heroku上推送node.js應用程序

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' 

回答

3

根據您的日誌,看起來Heroku無法檢測到您的應用的語言。

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

web: node index.js 
+0

都在我的package.json以及Procfile –

+1

都是這些文件在您的項目的根目錄? –

+0

另外,你是否推動你的項目的主分支提交這些文件? –

-2

去命令行,然後運行以下命令:

heroku buildpacks:set -a app_name heroku/node 
相關問題