nodejs heroku粉碎(h10错误)(defined_crc)

时间:2016-04-07 14:33:47

标签: node.js heroku

在不更改任何代码的情况下,我收到错误,而我之前部署到heroku的Web应用程序已成功。具体来说,我可以通过~~~~ .herokuapp.com看到我的网络应用。

我的环境:OSX ElCapitan和NodeJS。

现在我收到“应用程序错误”。

heroku logs -t输出:

2016-04-07T14:19:55.963042+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=study-event-app.herokuapp.com request_id=833eb1b0-5719-4bb9-9a61-fd6b9d687fdd fwd="131.113.37.94" dyno= connect= service= status=503 bytes=
    2016-04-07T14:19:56.611874+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=study-event-app.herokuapp.com request_id=d12f9e7c-2cf5-4d3a-95c1-61bc903b4511 fwd="131.113.37.94" dyno= connect= service= status=503 bytes=
    2016-04-07T14:21:40.323547+00:00 heroku[web.1]: State changed from crashed to starting
    2016-04-07T14:21:46.502676+00:00 heroku[web.1]: Starting process with command `node ./bin/www`
    2016-04-07T14:21:49.111984+00:00 app[web.1]: module.js:341
    2016-04-07T14:21:49.111997+00:00 app[web.1]:     throw err;
    2016-04-07T14:21:49.111998+00:00 app[web.1]:     ^
    2016-04-07T14:21:49.111998+00:00 app[web.1]: 
    2016-04-07T14:21:49.112023+00:00 app[web.1]: Error: Cannot find module './define_crc'
    2016-04-07T14:21:49.112031+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:339:15)
    2016-04-07T14:21:49.112032+00:00 app[web.1]:     at Function.Module._load (module.js:290:25)
    2016-04-07T14:21:49.112033+00:00 app[web.1]:     at Module.require (module.js:367:17)
    2016-04-07T14:21:49.112033+00:00 app[web.1]:     at require (internal/module.js:16:19)
    2016-04-07T14:21:49.112040+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/crc/lib/crc1.js:5:19)
    2016-04-07T14:21:49.112041+00:00 app[web.1]:     at Module._compile (module.js:413:34)
    2016-04-07T14:21:49.112042+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:422:10)
    2016-04-07T14:21:49.112042+00:00 app[web.1]:     at Module.load (module.js:357:32)
    2016-04-07T14:21:49.112043+00:00 app[web.1]:     at Function.Module._load (module.js:314:12)
    2016-04-07T14:21:49.112048+00:00 app[web.1]:     at Module.require (module.js:367:17)
    2016-04-07T14:21:50.065610+00:00 heroku[web.1]: Process exited with status 1
    2016-04-07T14:21:50.103251+00:00 heroku[web.1]: State changed from starting to crashed

heroku ps输出如下:

Free quota left: 17h 59m
=== web (Free): node ./bin/www (1)
web.1: crashed 2016/04/07 23:21:50 +0900 (~ 7m ago)

我试过了heroku restart web.1 --app 'app-name',但是这个命令并没有解决问题。显示:Error: Cannot find module './define_crc',但我不需要此模块。

我需要有关如何解决此问题的建议。

1 个答案:

答案 0 :(得分:0)

您可以尝试在heroku上清理nodes_module缓存:

heroku config:set NODEMODULESCACHE=false
git commit -a -m "rebuild" --allow-empty
git push heroku master
heroku config:unset NODEMODULESCACHE

如果这不能解决您的问题,是否满足以下所有条件?

  • 在package.json文件中指定节点和npm版本(参见engines
  • 所有依赖项都在package.json
  • 中声明
  • 您使用npm shrinkwrap来锁定所有软件包的版本