Heroku bash: node: command not found

Have someone out there got this error when starting a node app on heroku before?

2012-10-17T20:28:52+00:00 heroku[web.1]: Starting process with command `node app.js`
2012-10-17T20:28:53+00:00 app[web.1]: bash: node: command not found

It seems like the Heroku app are missing node.

The app starts just fine locally. Both foreman start and node app.js.

{
    "name": "app-name",
    "description": "some desc",
    "version": "0.0.1",
    "private": true,
    "engines": {
        "node": "0.8.12",
        "npm":  "1.1.49"
    },
    "dependencies": {
        "express" : "2.5.9",
        "mongoose" : ">=2.6.0",
        "colibri" : "*",
        "jade": ">= 0.0.1"
    }
}

tl;dr: Bumping into same issue, heroku restart worked for me.


Long version: this is how it went:

  1. In heroku logs I saw:

    heroku[slugc]: Slug compilation finished  
    heroku[web.1]: Starting process with command `node app.js`  
    app[web.1]: bash: node: command not found  
    heroku[web.1]: Process exited with status 127  
    heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path=/ host=node-network.herokuapp.com fwd=70.28.80.4 dyno= queue= wait= connect= service= status=503 bytes=
    heroku[web.1]: State changed from starting to down
    
  2. so I ran heroku restart, and got:

    heroku[web.1]: State changed from down to starting
    heroku[web.1]: Starting process with command `node app.js`
    app[web.1]: Listening on port 30693
    heroku[web.1]: State changed from starting to up
    

Heroku recognizes an app as Node.js by the existence of a package.json. Even if your app has no dependencies, you should still create a package.json that declares a name, version, and empty dependencies in order that it appear as a Node app.

https://devcenter.heroku.com/articles/nodejs