Heroku上的Node.js应用程序:退出状态8失败 - 应用程序名称包?

时间:2014-08-20 14:40:05

标签: node.js heroku

2014-08-18T06:12:54.374054+00:00 app[web.1]: npm ERR!     node app.js
2014-08-18T06:12:54.374153+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-18T06:12:53.681620+00:00 app[web.1]: 
2014-08-18T06:12:53.681638+00:00 app[web.1]: > application-name@0.0.1 start /app
2014-08-18T06:12:53.681641+00:00 app[web.1]: > node app.js
2014-08-18T06:12:53.681642+00:00 app[web.1]: 
2014-08-18T09:08:41.257725+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2014-08-18T09:08:41.258006+00:00 app[web.1]: npm ERR!     npm owner ls application-name
2014-08-18T09:08:41.257553+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-18T09:08:41.200012+00:00 app[web.1]: 
2014-08-18T09:08:41.256092+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2014-08-18T09:08:41.328006+00:00 app[web.1]: npm ERR! not ok code 0
2014-08-18T09:08:41.257897+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-18T09:08:41.255669+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `node app.js`
2014-08-18T09:08:41.256012+00:00 app[web.1]: npm ERR! 
2014-08-18T09:08:41.255860+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-18T09:08:41.260452+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2014-08-18T09:08:41.257637+00:00 app[web.1]: npm ERR! not with npm itself.
2014-08-18T09:08:41.305747+00:00 app[web.1]: npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "start"
2014-08-18T09:08:41.257819+00:00 app[web.1]: npm ERR!     node app.js
2014-08-18T1
5:48:38.818790+00:00 app[web.1]: Error: Most middleware (like json) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
2014-08-18T15:48:38.818796+00:00 app[web.1]:     at Function.Object.defineProperty.get (/app/node_modules/express/lib/express.js:89:13)
2014-08-18T15:48:38.818798+00:00 app[web.1]:     at Object.<anonymous> (/app/app.js:37:17)
2014-08-18T15:48:38.818800+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2014-08-18T15:48:38.818802+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
2014-08-18T15:48:38.818803+00:00 app[web.1]:     at Module.load (module.js:356:32)
2014-08-18T15:48:38.818804+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2014-08-18T15:48:38.818806+00:00 app[web.1]:     at Function.Module.runMain (module.js:497:10)
2014-08-18T15:48:38.818808+00:00 app[web.1]:     at startup (node.js:119:16)
2014-08-18T15:48:38.818809+00:00 app[web.1]:     at node.js:906:3
2014-08-18T15:48:38.852005+00:00 app[web.1]: 
2014-08-18T15:48:38.963950+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-18T15:48:38.964092+00:00 app[web.1]: npm ERR! 
2014-08-18T15:48:38.964243+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2014-08-18T15:48:38.964845+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-18T15:48:38.964941+00:00 app[web.1]: npm ERR! not with npm itself.
2014-08-18T15:48:38.965068+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2014-08-18T15:48:38.972537+00:00 app[web.1]: npm ERR!     node app.js
2014-08-18T15:48:38.972644+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-18T15:48:38.972791+00:00 app[web.1]: npm ERR!     npm owner ls application-name
2014-08-18T15:48:38.972864+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2014-08-18T15:48:39.003054+00:00 app[web.1]: npm ERR! System Linux 3.8.11-ec2
2014-08-18T15:48:39.003239+00:00 app[web.1]: npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "start"
2014-08-18T15:48:39.003377+00:00 app[web.1]: npm ERR! cwd /app
2014-08-18T15:48:39.034280+00:00 app[web.1]: npm ERR! node -v v0.10.30
2014-08-18T15:48:39.034505+00:00 app[web.1]: npm ERR! npm -v 1.4.21
2014-08-18T15:48:39.034627+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2014-08-18T15:48:39.053234+00:00 app[web.1]: npm ERR! 
2014-08-18T15:48:39.053356+00:00 app[web.1]: npm ERR! Additional logging details can be found in:
2014-08-18T15:48:39.053445+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2014-08-18T15:48:39.053666+00:00 app[web.1]: npm ERR! not ok code 0
2014-08-18T15:48:34.297578+00:00 app[web.1]: 
2014-08-18T15:48:34.297596+00:00 app[web.1]: > application-name@0.0.1 start /app
2014-08-18T15:48:34.297598+00:00 app[web.1]: > node app.js
2014-08-18T15:48:34.297599+00:00 app[web.1]: 
2014-08-18T15:48:38.807843+00:00 app[web.1]: 
2014-08-18T15:48:38.963600+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `node app.js`
2014-08-19T01:18:03.335113+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/robots.txt" host=www.supercuber.com request_id=2a27f766-9eba-4b64-a2eb-be9d666cbc6f fwd="208.115.111.73" dyno= connect= service= status=503 bytes=
2014-08-19T06:27:09.423387+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=supercuber.com request_id=cc9ecb87-a01f-4d75-97c9-83327bc0ea12 fwd="188.40.249.84" dyno= connect= service= status=503 bytes=
2014-08-19T07:29:59.457621+00:00 heroku[web.1]: State changed from crashed to starting
2014-08-19T07:30:05.636929+00:00 app[web.1]: 
2014-08-19T07:30:05.636950+00:00 app[web.1]: 
2014-08-19T07:30:05.636947+00:00 app[web.1]: > application-name@0.0.1 start /app
2014-08-19T07:30:06.272653+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-19T07:30:06.274102+00:00 app[web.1]: npm ERR! node -v v0.10.30
2014-08-19T07:30:06.272136+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2014-08-19T07:30:06.274218+00:00 app[web.1]: npm ERR! npm -v 1.4.21
2014-08-19T07:30:06.251287+00:00 app[web.1]: 
2014-08-19T07:30:06.273691+00:00 app[web.1]: npm ERR! System Linux 3.8.11-ec2
2014-08-19T07:30:06.275894+00:00 app[web.1]: npm ERR! 
2014-08-19T07:30:06.273411+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2014-08-19T07:30:06.276020+00:00 app[web.1]: npm ERR! Additional logging details can be found in:
2014-08-19T07:30:06.272036+00:00 app[web.1]: npm ERR! 
2014-08-19T07:30:06.273990+00:00 app[web.1]: npm ERR! cwd /app
2014-08-19T07:30:05.636949+00:00 app[web.1]: > node app.js
2014-08-19T07:30:06.273008+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2014-08-19T07:30:06.273285+00:00 app[web.1]: npm ERR!     npm owner ls application-name
2014-08-19T07:30:06.276125+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2014-08-19T07:30:06.273186+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-19T07:30:06.274337+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2014-08-19T07:30:06.271697+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `node app.js`
2014-08-19T07:30:06.272746+00:00 app[web.1]: npm ERR! not with npm itself.
2014-08-19T07:30:06.273099+00:00 app[web.1]: npm ERR!     node app.js
2014-08-19T07:30:06.271900+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-19T07:30:06.273861+00:00 app[web.1]: npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "start"
2014-08-19T07:30:07.487403+00:00 heroku[web.1]: State changed from starting to crashed
2014-08-19T13:13:46.311103+00:00 heroku[web.1]: Process exited with status 1
2014-08-19T13:13:43.465194+00:00 heroku[web.1]: Starting process with command `npm start`
2014-08-20T01:13:05.625215+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/BingSiteAuth.xml" host=www.supercuber.com request_id=60a05958-5b68-45b3-896d-4ffda351783e fwd="131.253.38.67" dyno= connect= service= status=503 bytes=
2014-08-20T01:13:05.480594+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.supercuber.com request_id=4ff53541-8a8d-43b6-a39c-db40924c9eac fwd="131.253.38.67" dyno= connect= service= status=503 bytes=
2014-08-20T02:43:17.133291+00:00 app[web.1]: > node app.js
2014-08-20T02:43:17.133270+00:00 app[web.1]: 
2014-08-20T02:43:17.133292+00:00 app[web.1]: 
2014-08-20T02:43:17.133289+00:00 app[web.1]: > application-name@0.0.1 start /app
2014-08-20T02:43:17.732000+00:00 app[web.1]: npm ERR! 
2014-08-20T02:43:17.732121+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2014-08-20T02:43:17.710159+00:00 app[web.1]: 
2014-08-20T02:43:17.731539+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `node app.js`
2014-08-20T02:43:17.731795+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-20T02:43:17.733311+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-20T03:10:55.501614+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.supercuber.com request_id=7ed9a3bd-755c-4d7b-bc23-1a3fa2152919 fwd="98.182.28.116" dyno= connect= service= status=503 bytes=

这是我的应用程序日志中输出的错误代码告诉我检查的内容。我在网上的研究和堆栈溢出的研究表明,这个错误似乎出现在各种各样的用例中,我不知道为什么它现在出现?我的应用程序本地运行正常实际上它曾经在heroku上运行,除非我刚刚进行了新的更改并尝试将它们推送到heroku,当我尝试启动应用程序时会发生这种情况。

编辑:目前我的app.js中有什么内容:

var bodyParser = require('body-parser');

var methodOverride = require('method-override');

var cookieParser = require('cookie-parser');
app.use(bodyParser());
app.use(methodOverride());
app.use(cookieParser());

1 个答案:

答案 0 :(得分:1)

npm告诉你出了什么问题:

2014-08-18T15:48:38.818790+00:00 app[web.1]: Error: Most middleware (like json) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
2014-08-18T15:48:38.818796+00:00 app[web.1]:     at Function.Object.defineProperty.get (/app/node_modules/express/lib/express.js:89:13)
2014-08-18T15:48:38.818798+00:00 app[web.1]:     at Object.<anonymous> (/app/app.js:37:17)
2014-08-18T15:48:38.818800+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2014-08-18T15:48:38.818802+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
2014-08-18T15:48:38.818803+00:00 app[web.1]:     at Module.load (module.js:356:32)
2014-08-18T15:48:38.818804+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2014-08-18T15:48:38.818806+00:00 app[web.1]:     at Function.Module.runMain (module.js:497:10)
2014-08-18T15:48:38.818808+00:00 app[web.1]:     at startup (node.js:119:16)
2014-08-18T15:48:38.818809+00:00 app[web.1]:     at node.js:906:3

如果您使用的是express 4.x.x,则必须单独require中间件。

例如,如果您使用的是express.bodyParser(),则需要执行以下步骤来替换它:

  1. 运行npm install body-parser --save
  2. 使用require语句在页面顶部附近添加此要求:var bodyParser = require('body-parser');
  3. 在您的应用中查找:
    • app.use(express.bodyParser());
    • app.use(express.urlencoded());
    • app.use(express.json());
  4. 使用此一行替换ALL:app.use(bodyParser());
  5. 然后,您必须为应用程序使用的所有其他中间件完成这些步骤,并列在connect migration guide上。