将应用程序部署到Heroku

时间:2018-02-20 12:46:37

标签: node.js heroku deployment

我已经使用cli将我的Node.js bot部署到heroku。当我尝试打开应用程序时,它会在日志中出现此错误:

2018-02-20T12:34:24.132994+00:00 app[web.1]: npm ERR! drvinebot@1.0.0 start: `node app.js`
2018-02-20T12:34:24.133186+00:00 app[web.1]: npm ERR! Exit status 1
2018-02-20T12:34:24.133463+00:00 app[web.1]: npm ERR! 
2018-02-20T12:34:24.133682+00:00 app[web.1]: npm ERR! Failed at the 
drvinebot@1.0.0 start script.
2018-02-20T12:34:24.133887+00:00 app[web.1]: npm ERR! This is probably not a 
problem with npm. There is likely additional logging output above.
2018-02-20T12:34:56.072459+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/" host=drvinebot.herokuapp.com 
request_id=8bf3595c-2ff8-4950-828c-0668e86e92bb fwd="106.203.157.18" dyno= 
connect= service= status=503 bytes= protocol=https
2018-02-20T12:34:57.812751+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/favicon.ico" host=drvinebot.herokuapp.com 
request_id=f716154a-35e7-446d-b05d-bca3bc26c06c fwd="106.203.157.18" dyno= 
connect= service= status=503 bytes= protocol=https
2018-02-20T12:35:43.707329+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/" host=drvinebot.herokuapp.com 
request_id=b0b38a2c-8164-44ca-bdf7-1f426bb327b3 fwd="106.203.157.18" dyno= 
connect= service= status=503 bytes= protocol=https
2018-02-20T12:35:45.472294+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/favicon.ico" host=drvinebot.herokuapp.com 
request_id=44814f37-d547-49c3-9cb4-d2454cedcb29 fwd="106.203.157.18" dyno= 
connect= service= status=503 bytes= protocol=https
2018-02-20T12:41:11.946966+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/" host=drvinebot.herokuapp.com 
request_id=af3e6bff-32d0-4a7a-8a72-b847d8b5b642 fwd="106.203.191.138" dyno= 
connect= service= status=503 bytes= protocol=https
2018-02-20T12:41:13.583622+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/favicon.ico" host=drvinebot.herokuapp.com 
request_id=63f94976-a986-48cb-81c3-a46706f782dc fwd="106.203.191.138" dyno= 
connect= service= status=503 bytes= protocol=https

这是我的package.json文件:

  "name": "drvinebot",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node app.js"
  },
  "author": "Joseph Joey",
  "license": "UNLICENSED",
   "dependencies": {
     "express": "^4.16.2",
     "helmet": "^3.11.0",
     "twit": "^2.2.9"
      }
   }

以前,我使用的是nodemon和应用程序仍然崩溃,所以我将procfile更改为:

web: npm start

使用npm脚本启动服务器。我似乎不明白这里有什么问题。有人可以帮我吗? 感谢。

0 个答案:

没有答案