【问题标题】:meteor push to heroku: cannot find main.js流星推送到heroku:找不到main.js
【发布时间】:2013-08-09 14:07:42
【问题描述】:

我在 tachyoned.heroku.com 上将 github.com/ee7klt/tachyoned 推送到 heroku 并收到应用程序错误。

我运行的命令是

heroku 创建 tachyoned --stack cedar --buildpack https://github.com/v8squirrel/heroku-buildpack-meteor.git git 远程添加 heroku git@heroku.com:tachyoned.git

heroku 插件:添加 mongohq:sandbox heroku 配置:设置 MONGO_URL=mongodb://[用户名]:[密码]@dharma.mongohq.com:10038/app123456

git push heroku 大师

日志如下:

2013-08-07T23:33:42.131685+00:00 app[web.1]: 
2013-08-07T23:33:42.132492+00:00 app[web.1]:     throw err;
2013-08-07T23:33:42.132650+00:00 app[web.1]:           ^
2013-08-07T23:33:42.132151+00:00 app[web.1]: module.js:340
2013-08-07T23:33:42.136470+00:00 app[web.1]: Error: Cannot find module '/app/.meteor/local/build/main.js'
2013-08-07T23:33:42.136470+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-08-07T23:33:42.136470+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-08-07T23:33:42.136470+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-08-07T23:33:42.136470+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-08-07T23:33:43.661641+00:00 heroku[web.1]: Process exited with status 1
2013-08-07T23:33:43.669264+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-07T23:33:51.564925+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-07T23:33:51.565183+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-07T23:43:48.945520+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-07T23:43:52.770843+00:00 heroku[web.1]: Starting process with command `PATH=.meteor/checkout:bin:/usr/local/bin:/usr/bin:/bin NODE_PATH=.meteor/checkout/dev_bundle/lib/node_modules MONGO_URL=mongodb://heroku:0e3fb1dbdff07bf0e063ea1b72f4e4f9@dharma.mongohq.com:10075/app17360457 .meteor/checkout/dev_bundle/bin/node .meteor/local/build/main.js`
2013-08-07T23:43:53.561690+00:00 app[web.1]: module.js:340
2013-08-07T23:43:53.558841+00:00 app[web.1]: 
2013-08-07T23:43:53.562348+00:00 app[web.1]:     throw err;
2013-08-07T23:43:53.562510+00:00 app[web.1]:           ^
2013-08-07T23:43:53.571503+00:00 app[web.1]: Error: Cannot find module '/app/.meteor/local/build/main.js'
2013-08-07T23:43:53.571503+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-08-07T23:43:53.571503+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-08-07T23:43:53.571503+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-08-07T23:43:53.571503+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-08-07T23:43:55.184433+00:00 heroku[web.1]: Process exited with status 1
2013-08-07T23:43:55.200547+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-07T23:54:23.340451+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-07T23:54:26.451563+00:00 heroku[web.1]: Starting process with command `PATH=.meteor/checkout:bin:/usr/local/bin:/usr/bin:/bin NODE_PATH=.meteor/checkout/dev_bundle/lib/node_modules MONGO_URL=mongodb://heroku:0e3fb1dbdff07bf0e063ea1b72f4e4f9@dharma.mongohq.com:10075/app17360457 .meteor/checkout/dev_bundle/bin/node .meteor/local/build/main.js`
2013-08-07T23:54:27.460339+00:00 app[web.1]: 
2013-08-07T23:54:27.460612+00:00 app[web.1]: module.js:340
2013-08-07T23:54:27.460997+00:00 app[web.1]:           ^
2013-08-07T23:54:27.460997+00:00 app[web.1]:     throw err;
2013-08-07T23:54:27.464956+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-08-07T23:54:27.464956+00:00 app[web.1]: Error: Cannot find module '/app/.meteor/local/build/main.js'
2013-08-07T23:54:27.464956+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-08-07T23:54:27.464956+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-08-07T23:54:27.464956+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-08-07T23:54:28.827639+00:00 heroku[web.1]: Process exited with status 1
2013-08-07T23:54:28.851257+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-07T23:54:36.668810+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-07T23:54:36.669232+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-08T00:04:31.981136+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T00:04:35.493835+00:00 heroku[web.1]: Starting process with command `PATH=.meteor/checkout:bin:/usr/local/bin:/usr/bin:/bin NODE_PATH=.meteor/checkout/dev_bundle/lib/node_modules MONGO_URL=mongodb://heroku:0e3fb1dbdff07bf0e063ea1b72f4e4f9@dharma.mongohq.com:10075/app17360457 .meteor/checkout/dev_bundle/bin/node .meteor/local/build/main.js`
2013-08-08T00:04:36.064989+00:00 app[web.1]: module.js:340
2013-08-08T00:04:36.064820+00:00 app[web.1]: 
2013-08-08T00:04:36.065232+00:00 app[web.1]:     throw err;
2013-08-08T00:04:36.065232+00:00 app[web.1]:           ^
2013-08-08T00:04:36.068426+00:00 app[web.1]: Error: Cannot find module '/app/.meteor/local/build/main.js'
2013-08-08T00:04:36.068426+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-08-08T00:04:36.068426+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-08-08T00:04:36.068426+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-08-08T00:04:36.068426+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-08-08T00:04:37.315336+00:00 heroku[web.1]: Process exited with status 1
2013-08-08T00:04:37.336949+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T00:15:03.729386+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T00:15:06.818328+00:00 heroku[web.1]: Starting process with command `PATH=.meteor/checkout:bin:/usr/local/bin:/usr/bin:/bin NODE_PATH=.meteor/checkout/dev_bundle/lib/node_modules MONGO_URL=mongodb://heroku:0e3fb1dbdff07bf0e063ea1b72f4e4f9@dharma.mongohq.com:10075/app17360457 .meteor/checkout/dev_bundle/bin/node .meteor/local/build/main.js`
2013-08-08T00:15:07.828259+00:00 app[web.1]:     throw err;
2013-08-08T00:15:07.828259+00:00 app[web.1]:           ^
2013-08-08T00:15:07.827889+00:00 app[web.1]: 
2013-08-08T00:15:07.828022+00:00 app[web.1]: module.js:340
2013-08-08T00:15:07.851308+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-08-08T00:15:07.851308+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-08-08T00:15:07.851308+00:00 app[web.1]: Error: Cannot find module '/app/.meteor/local/build/main.js'
2013-08-08T00:15:07.851308+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-08-08T00:15:07.851308+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-08-08T00:15:09.263358+00:00 heroku[web.1]: Process exited with status 1
2013-08-08T00:15:09.271063+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T00:15:16.938605+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-08T00:15:16.938822+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-08T00:25:10.987765+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T00:25:13.444061+00:00 heroku[web.1]: Starting process with command `PATH=.meteor/checkout:bin:/usr/local/bin:/usr/bin:/bin NODE_PATH=.meteor/checkout/dev_bundle/lib/node_modules MONGO_URL=mongodb://heroku:0e3fb1dbdff07bf0e063ea1b72f4e4f9@dharma.mongohq.com:10075/app17360457 .meteor/checkout/dev_bundle/bin/node .meteor/local/build/main.js`
2013-08-08T00:25:14.183806+00:00 app[web.1]: 
2013-08-08T00:25:14.183994+00:00 app[web.1]: module.js:340
2013-08-08T00:25:14.184233+00:00 app[web.1]:     throw err;
2013-08-08T00:25:14.184333+00:00 app[web.1]:           ^
2013-08-08T00:25:14.188434+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-08-08T00:25:14.188340+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-08-08T00:25:14.188611+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-08-08T00:25:14.188217+00:00 app[web.1]: Error: Cannot find module '/app/.meteor/local/build/main.js'
2013-08-08T00:25:14.188522+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-08-08T00:25:15.593607+00:00 heroku[web
.1]: Process exited with status 1
2013-08-08T00:25:15.592170+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T00:25:23.604481+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-08T00:25:23.604793+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-08T00:35:16.833507+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T00:35:19.209732+00:00 heroku[web.1]: Starting process with command `PATH=.meteor/checkout:bin:/usr/local/bin:/usr/bin:/bin NODE_PATH=.meteor/checkout/dev_bundle/lib/node_modules MONGO_URL=mongodb://heroku:0e3fb1dbdff07bf0e063ea1b72f4e4f9@dharma.mongohq.com:10075/app17360457 .meteor/checkout/dev_bundle/bin/node .meteor/local/build/main.js`
2013-08-08T00:35:19.804272+00:00 app[web.1]:     throw err;
2013-08-08T00:35:19.803916+00:00 app[web.1]: 
2013-08-08T00:35:19.804272+00:00 app[web.1]:           ^
2013-08-08T00:35:19.807308+00:00 app[web.1]: Error: Cannot find module '/app/.meteor/local/build/main.js'
2013-08-08T00:35:19.804053+00:00 app[web.1]: module.js:340
2013-08-08T00:35:19.807308+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-08-08T00:35:19.807308+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-08-08T00:35:19.807308+00:00 app[web.1]:     at Module.runMain (module.js:492:10)
2013-08-08T00:35:19.807308+00:00 app[web.1]:     at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2013-08-08T00:35:20.890080+00:00 heroku[web.1]: Process exited with status 1
2013-08-08T00:35:20.894770+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T00:43:43.506885+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=tachyoned.herokuapp.com fwd="175.143.199.51" dyno= connect= service= status=503 bytes=
2013-08-08T00:43:44.331624+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=tachyoned.herokuapp.com fwd="175.143.199.51" dyno= connect= service= status=503 bytes=
2013-08-08T00:43:55.821151+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=tachyoned.herokuapp.com fwd="175.143.199.51" dyno= connect= service= status=503 bytes=
2013-08-08T00:43:56.658774+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=tachyoned.herokuapp.com fwd="175.143.199.51" dyno= connect= service= status=503 bytes=

关于如何解决这个问题的任何想法?

【问题讨论】:

    标签: node.js heroku meteor


    【解决方案1】:

    我以前没有用 Heroku 做过,但这可能会有所帮助:

    https://coderwall.com/p/gurjmw

    【讨论】:

      【解决方案2】:

      我发现这个链接是一个很好的指南(对我来说很遗憾): http://ondrej-kvasnovsky.blogspot.cz/2013/05/how-to-deploy-meteor-on-heroku-with.html

      对于您的问题,我会使用他们上面提到的 buildpack:https://github.com/oortcloud/heroku-buildpack-meteorite

      将其添加到 Heroku:

      heroku config:set BUILDPACK_URL=https://github.com/oortcloud/heroku-buildpack-meteorite.git  -a app-nam
      

      然后我发现由于我有一个现有的部分应用程序,它没有为 node 或 main.js 正确设置路径,导致找不到命令错误。

      在我处理实际实例之后,我必须将此部分添加到Procfile:

      web: .meteor/heroku_build/bin/node .meteor/heroku_build/app/main.js
      

      这就是诀窍。

      ** 更新**:提到的原始 Buildpack 可能有点过时了。 buildpack meteor-buildpack-horse 仍在更新中:https://github.com/AdmitHub/meteor-buildpack-horse

      【讨论】:

      • 我所有的代码都不在根目录下。实际上,它们在一个目录中。如何告诉 Heroku 在此文件夹中搜索 package.json 而不是在 repo 的根目录中搜索?
      • 我更新了我的答案以指向另一个仍然具有一定吸引力的 buildpack。它有一个选项METEOR_APP_DIR,您可以使用它来指定您的根目录。
      猜你喜欢
      • 2015-12-29
      • 2014-01-25
      • 1970-01-01
      • 1970-01-01
      • 2019-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多