unable to push node.js app on heroku

北慕城南 提交于 2021-01-27 19:20:46

问题


I tried pushing my node.js application on heroku but. No default language could be detected for this app. I even tried heroku buildpacks:set heroku/nodejs. But still unable to push.

 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'

回答1:


Based on your logs, it looks like Heroku can't detect the language of your app.

For Node.js, you need to either create a package.json file in the root your project (using something like npm init), or you can create a Procfile in the root of your project to specify your language:

web: node index.js



回答2:


go to command line and run following command :

heroku buildpacks:set -a app_name heroku/node


来源:https://stackoverflow.com/questions/39644067/unable-to-push-node-js-app-on-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!