0

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?

HellaDev
  • 408
  • 2
  • 8
  • 24
  • Possible duplicate of [Can't push to the heroku](https://stackoverflow.com/questions/38841284/cant-push-to-the-heroku) – Alex Taylor Sep 13 '17 at 22:58

1 Answers1

2

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

  • Ok, I reconfigured this and put the package.json file in my project root and ran npm install to get everything setup. It's working locally but when I run `git push heroku master` it gives me the same language error. Do I need to specify node beyond `"engines": { "node": "x.x.x" }` in the package.json? – HellaDev Sep 13 '17 at 23:46
  • ignore that last one. I didn't commit it. My bad. It's working now after following your instruction and committing the changes. thank you! – HellaDev Sep 13 '17 at 23:57