流星与cloud9 [英] Meteor with cloud9

查看:72
本文介绍了流星与cloud9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在cloud9中运行流星时,我遇到以下错误之一:

When trying to run meteor in cloud9 I encounter one of the following errors:

运行较旧的 cloud9的修改版本我收到错误消息:

Running the older modified version from cloud9 I get the error:

No dependency info in bundle. Filesystem monitoring disabled.
=> Errors prevented startup:
Exception while bundling application:
Error: Package not found: standard-app-packages
    at self.api.use (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/tools/bundler.js:113:17)
    at Array.forEach (native)
    at Function._.each._.forEach (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
    at Object.self.api.use (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/tools/bundler.js:110:9)

当我尝试运行< a href = https://github.com/meteor/meteor/tree/master>最新版本,我从cloud9收到错误消息:

When I try running the lastest version, I get an error from cloud9:

Cloud9  Error: you may be using the wrong PORT & HOST for your server app
        Node: use 'process.env.PORT' as the port and 'process.env.IP' as the host in your scripts. See also https://c9.io/site/blog/2013/05/can-i-use-cloud9-to-do-x/

在两种情况下,我都克隆相应的GitHub存储库并运行 export BIND_IP = $ IP 以及 export PORT = 20000 (如几篇文章中所述)。我也放弃了使用默认MongoDB服务器的希望,而是将 MONGO_URL 导出到 https://www.mongohq.com/

In both cases, I clone the corresponding GitHub repository and run export BIND_IP=$IP as well as export PORT=20000 (as it is described in on several posts). I also gave up the hope using the default MongoDB server and am instead exporting MONGO_URL to a free database hosted on https://www.mongohq.com/.

我也尝试将cloud9的流星版本的拉取请求合并到主节点,但是这些文件甚至不存在了。我能找到的所有其他内容都是关于Meteor版本0.6.5和0.5

I've also tried to merge the pull request from cloud9's meteor version to the master, but those files don't even exist anymore. Everything else I could find was about Meteor version 0.6.5 and 0.5

尝试修改最新的Meteor版本我在 httpServer.listen中寻找调用,但是我在 meteor / packages / webapp / webapp_server.js 中只找到一个,似乎在那部分之前抛出了cloud9错误达到代码数量(如果曾经达到过)。因此,必须有另一段绑定到错误地址或端口的代码。

Trying to modify the latest Meteor-version I looked for the httpServer.listen call, but I found only one in meteor/packages/webapp/webapp_server.js, and it seems that the cloud9 error is thrown before that part of code is reached (if it is ever reached). So that there must be a another piece of code which is bound to the wrong address or port.

我使用的插件是:

standard-app-packages
insecure
preserve-inputs
underscore
backbone
jquery
accounts-ui
accounts-base
accounts-password
accounts-facebook
accounts-google
coffeescript






更新:

经过几个小时寻找解决方案后,我走了很多。问题出在 meteor / tools / run-proxy.js

After some more hours looking for a solution, I got much further. The problem was in meteor/tools/run-proxy.js:

在第94行中,您可以看到: self.server.listen(self.listenPort,function(){流星曾经使用环境变量 BIND_IP ,我们可以在这里再次介绍它,但这将对服务器造成不必要的额外更改。 cloud9,因为它们将当前应绑定服务的IP地址导出到 IP 变量中,因此我将相关行更改为: self .server.listen(self.listenPort,process.env.IP,function(){

In line 94 you can see: self.server.listen(self.listenPort, function () { here is the corresponding IP-address missing to which the server should bind itself. Now meteor used to use an environmental variable BIND_IP which we could introduce here again, but this would have unnecessary additional changes on cloud9, since they export the current IP address to which a service should bind itself in the IP variable. So I changed the line in question to: self.server.listen(self.listenPort, process.env.IP, function () {

我还另外修改了 meteor / tools / run-all.js ,因为我不确定是否正确使用端口参数在线24我用 var listenPort = process.env.PORT;

I've also additionally modified meteor/tools/run-all.js, since I wasn't sure if the correct port parameter is used. On line 24 I exchanged var listenPort = options.port; with var listenPort = process.env.PORT;

虽然现在我终于可以启动该应用程序,但它仍未运行,并且得到以下输出:

While I can now finally start the application, it is still not running and I'm getting the following output:

=> Running Meteor from a checkout -- overrides project version (0.7.2)
[[[[[ ~/<PROJECT_ID>/<PROJECT_NAME> ]]]]]

=> Started proxy.
W20140321-22:31:42.591(-4)? (STDERR) 
W20140321-22:31:43.036(-4)? (STDERR) events.js:72
W20140321-22:31:43.037(-4)? (STDERR)         throw er; // Unhandled 'error' event
W20140321-22:31:43.037(-4)? (STDERR)               ^


 Cloud9  Error: you may be using the wrong PORT & HOST for your server app
         Node: use 'process.env.PORT' as the port and 'process.env.IP' as the host in your scripts. See also https://c9.io/site/blog/2013/05/can-i-use-cloud9-to-do-x/
W20140321-22:31:43.108(-4)? (STDERR) Error: listen EACCES
W20140321-22:31:43.109(-4)? (STDERR)     at errnoException (net.js:901:11)
W20140321-22:31:43.109(-4)? (STDERR)     at Server._listen2 (net.js:1020:19)
W20140321-22:31:43.111(-4)? (STDERR)     at listen (net.js:1061:10)
W20140321-22:31:43.111(-4)? (STDERR)     at net.js:1143:9
W20140321-22:31:43.112(-4)? (STDERR)     at dns.js:72:18
W20140321-22:31:43.112(-4)? (STDERR)     at process._tickCallback (node.js:415:13)
=> Exited with code: 8

但是,流星并没有崩溃,而且异常不断出现。这就是为什么我首先想到的,该异常是由于MongoDB上的身份验证错误所致,因为MongoDB的错误代码8也是身份验证错误,但这是在MongoHQ托管的数据库上使用无效的用户名和密码时得到的:

However meteor doesn't crash and the exceptions keep coming in one after another. That's why I first thought, the exception is due to an authentication error on MongoDB, since also Error-Code 8 for MongoDB is authentication error, but this is what I get when I use an invalid username + password on my MongoHQ-hosted database:

[...]
=> Started proxy.
W20140321-22:54:17.282(-4)? (STDERR) 
W20140321-22:54:18.700(-4)? (STDERR) /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/mongo_client.js:400
W20140321-22:54:18.777(-4)? (STDERR)               throw err
W20140321-22:54:18.778(-4)? (STDERR)                     ^
W20140321-22:54:18.778(-4)? (STDERR) MongoError: auth fails
W20140321-22:54:18.778(-4)? (STDERR)     at Object.toError (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/utils.js:110:11)
W20140321-22:54:18.779(-4)? (STDERR)     at /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/auth/mongodb_cr.js:34:33
W20140321-22:54:18.779(-4)? (STDERR)     at /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/db.js:1670:9
W20140321-22:54:18.779(-4)? (STDERR)     at Server.Base._callHandler (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/base.js:382:41)
W20140321-22:54:18.780(-4)? (STDERR)     at /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/server.js:472:18
W20140321-22:54:18.780(-4)? (STDERR)     at MongoReply.parseBody (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
W20140321-22:54:18.780(-4)? (STDERR)     at null.<anonymous> (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/server.js:430:20)
W20140321-22:54:18.781(-4)? (STDERR)     at EventEmitter.emit (events.js:95:17)
W20140321-22:54:18.781(-4)? (STDERR)     at null.<anonymous> (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:191:13)
W20140321-22:54:18.782(-4)? (STDERR)     at EventEmitter.emit (events.js:98:17)
=> Exited with code: 8

此错误在 meteor / packages / mongo-livedata / mongo_driver.js 在149行:

147:      MongoDB.connect(url, mongoOptions, function(err, db) {
148:        if (err)
149:          throw err;
150:        self.db = db;

这也可以,但是我不能

推荐答案

最初我遇到了类似的问题,但最新版本的Meteor(0.9.0)至少使此操作变得容易。

I just ran into similar issues initially, but the latest version of Meteor (0.9.0) makes this easy at least.

meteor run --port=$IP:$PORT

似乎可以解决问题(至少到目前为止)

Seems to do the trick (at least so far)

这已记录在

meteor help run

hth

安迪

这篇关于流星与cloud9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆