HellaDev
HellaDev

Reputation: 408

Cannot push project to Heroku "no default language detected"

I am trying to push a project to Heroku and I am receiving the error "no default language detected". My project is built on Node and the structure is as follows:

project/
  .gitignore
  Procfile
  server/
    package.json
    index.js
    ...etc

In my Procfile (since my package.json is not located in the project root) I have the following line of code:

Procfile:

web: node index.js

I am pushing by running: git push heroku master

where I then get the error "no default language detected" and despite my best google/SO searching efforts, I cannot find a proper solution to get past this. What am I missing here?

Upvotes: 0

Views: 157

Answers (1)

Pavel Varentsov
Pavel Varentsov

Reputation: 74

Your package.json must be in the root directory.
You can change the structure of your project or try to push a subdirectory of your project by running: git subtree push --prefix server heroku master

Upvotes: 2

Related Questions