22

以前にherokuでノードアプリを起動したときにこのエラーが発生した人はいますか?

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

Heroku アプリにノードがないようです。

アプリはローカルで問題なく起動します。foreman start と 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"
    }
}
4

6 に答える 6

7

古い質問ですが、にenginesセクションを追加してみてくださいpackage.json:

"engines": {
    "node": ">= 6.9.4",
    "npm": ">= 4.4.0"
  }
于 2017-05-27T13:44:42.943 に答える
2

Herokuは、package.jsonの存在により、アプリをNode.jsとして認識します。アプリに依存関係がない場合でも、ノードアプリとして表示されるように、名前、バージョン、および空の依存関係を宣言するpackage.jsonを作成する必要があります。

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

于 2012-10-17T21:26:00.990 に答える
2

tl;dr:同じ問題にぶつかって、heroku restartうまくいきました。


ロングバージョン:これがどのように進んだかです:

  1. 私が見たheroku logs

    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. だから私は走っheroku restartて、得た:

    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
    
于 2013-02-06T18:35:03.493 に答える