【问题标题】:Node app failed on HerokuHeroku 上的节点应用程序失败
【发布时间】:2016-04-08 10:34:05
【问题描述】:

我已经设法将https://github.com/hexojs/hexo 推送到heroku,但是当我在http://warm-shelf-26895.herokuapp.com/ 查看应用程序时,它完全失败了。

我是新手,谁能告诉我出了什么问题以及如何解决这个问题?太棒了

$heroku logs
2016-04-08T09:04:12.913757+00:00 heroku[api]: Enable Logplex by kradzcalypse@icloud.com
2016-04-08T09:04:12.913787+00:00 heroku[api]: Release v2 created by kradzcalypse@icloud.com
2016-04-08T09:45:15.587805+00:00 heroku[api]: Scale to web=1 by kradzcalypse@icloud.com
2016-04-08T09:45:15.669657+00:00 heroku[api]: Deploy fcfe397 by kradzcalypse@icloud.com
2016-04-08T09:45:15.669657+00:00 heroku[api]: Release v3 created by kradzcalypse@icloud.com
2016-04-08T09:45:16.046236+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-08T09:45:16.046251+00:00 heroku[slug-compiler]: Slug compilation finished
2016-04-08T09:45:17.763235+00:00 heroku[web.1]: Starting process with command `npm start`
2016-04-08T09:45:19.851147+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-04-08T09:45:19.851749+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-04-08T09:45:19.852084+00:00 app[web.1]: npm ERR! node v5.10.0
2016-04-08T09:45:19.852499+00:00 app[web.1]: npm ERR! npm  v3.8.3
2016-04-08T09:45:19.853761+00:00 app[web.1]: 
2016-04-08T09:45:19.854672+00:00 app[web.1]: npm ERR! missing script: start
2016-04-08T09:45:19.854860+00:00 app[web.1]: npm ERR! 
2016-04-08T09:45:19.855012+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-04-08T09:45:19.855162+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2016-04-08T09:45:19.862944+00:00 app[web.1]: 
2016-04-08T09:45:19.863162+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-04-08T09:45:19.863322+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2016-04-08T09:45:20.533551+00:00 heroku[web.1]: Process exited with status 1
2016-04-08T09:45:20.555438+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-08T09:45:20.555438+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-08T09:45:22.881666+00:00 heroku[web.1]: Starting process with command `npm start`
2016-04-08T09:45:26.272162+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-04-08T09:45:26.273164+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-04-08T09:45:26.273607+00:00 app[web.1]: npm ERR! node v5.10.0
2016-04-08T09:45:26.274846+00:00 app[web.1]: npm ERR! npm  v3.8.3
2016-04-08T09:45:26.277179+00:00 app[web.1]: 
2016-04-08T09:45:26.278900+00:00 app[web.1]: npm ERR! missing script: start
2016-04-08T09:45:26.279148+00:00 app[web.1]: npm ERR! 
2016-04-08T09:45:26.279341+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-04-08T09:45:26.281819+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2016-04-08T09:45:26.292949+00:00 app[web.1]: 
2016-04-08T09:45:26.293196+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-04-08T09:45:26.293328+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2016-04-08T09:45:27.124881+00:00 heroku[web.1]: Process exited with status 1
2016-04-08T09:45:27.140895+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-08T09:45:30.487088+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-shelf-26895.herokuapp.com request_id=e68542c6-df1f-45f4-9d91-db7b1d8dd946 fwd="175.140.32.164" dyno= connect= service= status=503 bytes=
2016-04-08T09:45:31.041140+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-shelf-26895.herokuapp.com request_id=2de0617a-7eeb-48a9-b52d-b8a46173d937 fwd="175.140.32.164" dyno= connect= service= status=503 bytes=
2016-04-08T09:46:38.285172+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-shelf-26895.herokuapp.com request_id=4b14dd49-1fdc-4875-ac22-824c5d37882e fwd="175.140.32.164" dyno= connect= service= status=503 bytes=
2016-04-08T09:46:38.945206+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-shelf-26895.herokuapp.com request_id=ebf705e1-bdb6-4920-91c8-3a2c9ca6f886 fwd="175.140.32.164" dyno= connect= service= status=503 bytes=
2016-04-08T09:58:59.898426+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-shelf-26895.herokuapp.com request_id=5b02691f-9a0a-417a-be78-6dad9cf03166 fwd="175.140.32.164" dyno= connect= service= status=503 bytes=
2016-04-08T09:59:00.442958+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-shelf-26895.herokuapp.com request_id=eee3f185-f71b-416e-a0e8-2755b232029d fwd="175.140.32.164" dyno= connect= service= status=503 bytes=
2016-04-08T10:09:10.794586+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-08T10:09:12.937261+00:00 heroku[web.1]: Starting process with command `npm start`
2016-04-08T10:09:15.021924+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-04-08T10:09:15.022475+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-04-08T10:09:15.022808+00:00 app[web.1]: npm ERR! node v5.10.0
2016-04-08T10:09:15.023416+00:00 app[web.1]: npm ERR! npm  v3.8.3
2016-04-08T10:09:15.025088+00:00 app[web.1]: 
2016-04-08T10:09:15.026532+00:00 app[web.1]: npm ERR! missing script: start
2016-04-08T10:09:15.026673+00:00 app[web.1]: npm ERR! 
2016-04-08T10:09:15.026844+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2016-04-08T10:09:15.026761+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-04-08T10:09:15.035679+00:00 app[web.1]: 
2016-04-08T10:09:15.035839+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-04-08T10:09:15.035928+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2016-04-08T10:09:15.765024+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-08T10:09:15.740933+00:00 heroku[web.1]: Process exited with status 1
2016-04-08T10:25:12.503232+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-08T10:25:12.503240+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/nodejs
2016-04-08T10:25:12.503242+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2016-04-08T10:26:22.776928+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-shelf-26895.herokuapp.com request_id=74d90d49-75ed-4fbc-a0c6-b463bf599c8b fwd="175.140.32.164" dyno= connect= service= status=503 bytes=
2016-04-08T10:26:23.745972+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-shelf-26895.herokuapp.com request_id=59c101ef-28af-4c01-bb9a-644e86077a01 fwd="175.140.32.164" dyno= connect= service= status=503 bytes=

【问题讨论】:

  • 在本地运行“npm start”会发生什么?你能发布你的 package.json 吗?
  • npm 错误!达尔文 15.0.0 npm 错误! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm 错误!节点 v4.4.2 npm 错误! npm v2.15.0 npm 错误!缺少脚本:启动 npm ERR! npm 错误!如果您需要帮助,您可以在以下位置报告此错误:npm ERR! github.com/npm/npm/issues> npm 错误!请在任何支持请求中包含以下文件:npm ERR! /Applications/MAMP/htdocs/hexo/blog/npm-debug.log
  • package.json { "name": "hexo-site", "version": "0.0.0", "private": true, "hexo": { "version": "3.2. 0" }, "依赖项": { "hexo": "^3.2.0", "hexo-deployer-git": "^0.1.0", "hexo-deployer-heroku": "^0.1.0", “hexo-deployer-rsync”:“^0.1.1”,“hexo-generator-archive”:“^0.1.4”,“hexo-generator-category”:“^0.1.3”,“hexo-generator- index”:“^0.2.0”,“hexo-generator-tag”:“^0.2.0”,“hexo-renderer-ejs”:“^0.2.0”,“hexo-renderer-marked”:“^ 0.2.10", "hexo-renderer-stylus": "^0.3.1", "hexo-server": "^0.2.0" } }

标签: heroku hexo


【解决方案1】:

您应该在 package.json 中包含一个脚本部分,指定用于启动应用程序的正确节点命令。例如:

scripts": {
  "test": "echo \"Error: no test specified\" && exit 1",
  "start": "node app.js"
},

【讨论】:

  • 我包含在 package.json "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "hexo server" }, 得到以下错误:远程:-----> Node.js 应用程序检测到远程:解析错误:第 24 行第 8 列远程的无效数字文字:!无法解析 package.json 远程:远程:远程:-----> 构建失败
猜你喜欢
  • 2015-02-28
  • 1970-01-01
  • 2012-12-21
  • 1970-01-01
  • 2014-11-15
  • 2017-08-21
  • 2016-04-22
  • 1970-01-01
  • 2018-10-04
相关资源
最近更新 更多