Tag: 陨石

meteorEADDRINUSEexception与光纤远程方法

以下是我在server / server.js文件中的代码。 当我打电话给Meteor.apply('testMethod')我得到Error: listen EADDRINUSE 。 我正在用陨石运行meteor应用,唯一安装的非通用软件包是npm var Fiber = Meteor.require('fibers'); var fiber = Fiber.current; Meteor.methods({ testMethod: function(){ setTimeout(function(){fiber.run('test')}, 2000); res = Fiber.yield(); console.log(res); return res; } }) 我知道这里最明显的解决scheme是使用Meteor的光纤包装,但是我真正想要实现的是从asynchronous调用中的光纤产生,然后在某个事件处理程序中恢复。 而且我还没有find适合的东西。 堆栈跟踪: Error: listen EADDRINUSE at errnoException (net.js:901:11) at Server._listen2 (net.js:1039:14) at listen (net.js:1061:10) at net.js:1135:9 at dns.js:72:18 at process._tickCallback (node.js:415:13)

meteor模板助手条件一贯返回false

我对meteor很新,但到目前为止,我真的很喜欢这个平台的编码。 我碰到了一些障碍,似乎找不到正确的方法。 我想创build一个帮助函数,将检查经纬度和检查它对预定义的范围,如果它落在这些之间它返回true。 我已经包含了我现在的代码: Template.header.helpers({ locationCheck: function() { navigator.geolocation.getCurrentPosition(success_callback,error_callback); function success_callback(p){ // Building Latitude = 51.522206 // Building Longitude = -0.078305 var lat = parseFloat(p.coords.latitude); var lon = parseFloat(p.coords.longitude); console.log('Latitude: '+lat); console.log('Longitiude: '+lon); if( lat >= 51.521606 && lat <= 51.522606 && lon >= -0.078805 && lon <= -0.077705 ) { console.log('you are in the […]

meteor的restrictCreationByEmailDomain选项如何工作?

我刚刚阅读meteor的帐户configuration选项,“restrictCreationByEmailDomain”选项是真棒 Accounts.config({ restrictCreationByEmailDomain: 'school.edu' }) 我想知道我可以使用由逗号或数组分隔的域名列表来代替'school.edu'吗?meteor账户系统有没有简单的教程? 请帮助

错误:无法find所有Meteor命令在控制台中引发的模块“下划线”

错误:无法find所有Meteor命令在控制台中引发的模块“下划线” 在每一个meteor或陨石命令,如meteor或mrt create myapp ,抛出以下错误。 这个错误似乎突然出现,因为meteor在前一天晚上是function性的,从那以后没有任何改变。 Austins-MacBook-Pro:Projects austinrivas$ mrt create test-app /Users/austinrivas/.meteor/tools/3cba50c44a/tools/meteor.js:1480 }).run(); ^ Error: Cannot find module 'underscore' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at /Users/austinrivas/.meteor/tools/3cba50c44a/tools/meteor.js:10:11 我已经尝试用sudo npm install -g underscore手动sudo npm install -g underscore返回 Austins-MacBook-Pro:Projects austinrivas$ sudo npm install -g underscore Password: npm http GET https://registry.npmjs.org/underscore npm […]

包含NPM包的Meteor.js中的'require is not defined'

我正在尝试使用Meteor.js (版本0.6.6.3)使用Meteor.require来使用npm包。 然而,它会抛出一个错误,说require没有被定义。 为什么是这个,我们该如何解决呢? mrt add npm npm install github packages.json { "github": "0.1.8" } github.js var GITHUB = Meteor.require('github'); 错误 ReferenceError: require is not defined npm软件包有如 var https = require('https') var url = require('url') var crypto = require('crypto') 必须手动编辑软件包的代码才能使用Npm.require ? 手动编辑他们摆脱了错误。 然而,一条线: module.exports = SOMETHING 我们应该如何从meteor内部调用module ?

如何使用Meteor路由器(NodeJS)的文件系统的createReadStream

我需要允许我的应用程序的用户下载与meteor文件。 目前我所做的是当用户请求下载一个文件到我在Mongo的“fileRequests”集合中input文件位置和请求的时间戳,并返回新创build的请求的ID。 当客户端获得新的ID时,它立即进入mydomain.com/uploads/:id。 然后,我在Meteor之前使用这样的方法来拦截请求: var connect = Npm.require("connect"); var Fiber = Npm.require("fibers"); var path = Npm.require('path'); var fs = Npm.require("fs"); var mime = Npm.require("mime"); __meteor_bootstrap__.app .use(connect.query()) .use(connect.bodyParser()) //I add this for file-uploading .use(function (req, res, next) { Fiber(function() { if(req.method == "GET") { // get the id here, and stream the file using fs.createReadStream(); } […]

错误:捆绑Meteor.js应用程序时没有这样的包

当我的Meteor应用程序被捆绑(使用Meteor UP mup deploy )时,它会在下面给出一组错误。 捆绑之前,我必须使用Meteorite手动安装(全球?)这些软件包吗? $ mup deploy Meteor-UP : Production Quality Meteor Deployments ————————————————– Bundling Started: /var/www/test-app Bundling Error: Command failed: ——————-STDOUT——————- rss: updating npm dependencies — rss… mailchimp: updating npm dependencies — mailchimp… Errors prevented bundling: While building the application: error: no such package: 'database-forms' error: no such package: 'crypto-md5' error: no […]

使用ClojureScript写入meteor

目前是否有将ClojureScript与Meteor集成的解决scheme? 我想要构build一个Meteor应用程序,并且在JavaScript(JavaScript,CoffeeScript,TypeScript,LiveScript和ClojureScript)的风格之间,我觉得ClojureScript是最好的。 我发现了其他JavaScript替代品的氛围/陨石包,但没有findClojureScript。 谢谢

meteor铁路由器布局呈现

我们已经实现了主要内容驻留在dynamic侧边栏的布局。 我们定义了如下的layoutTemplate : <template name="layout"> {{> content}} {{> leftbar}} {{> rightbar}} <nav class="navigation"> {{#if currentUser}} {{> navigation_logged_in}} {{else}} {{> navigation_logged_out}} {{/if}} </nav> </template> 我们在布局模板中包含右栏模板。 <template name="rightbar"> <aside class="rightbar"> <button id="closeRightBar" class="close-cross"></button> {{yield 'rightbar'}} </aside> </template> 右栏模板包含我们将特定内容input到的右栏版本。 我们已经实现了下面的RouteController: UserShowRouter = RouteController.extend({ before: function() { var username = this.params.username; if(App.subs.user) { App.subs.user.stop(); } App.subs.user = Meteor.subscribe('user', username); […]

如何访问Meteor的客户端IP地址?

这似乎是一个非常基本的问题,没有一个优雅的解决scheme/答案在那里。 如何从(1)服务器或(2)客户端访问客户端(远程)IP地址?