Tag: meteor

将Node.js应用程序部署到Heroku。 错误NPM_CONFIG_LOGLEVEL =错误

我在heroku上部署我的node.js应用程序,但是当我运行我的应用程序时,它显示我应用程序错误,当我检查我的日志文件,我发现NPM_CONFIG_LOGLEVEL =错误 我的package.json文件是: { "name": "wework-1", "version": "1.0.0", "description": "We Work Meteor, a job board and developer directory for Meteor specific work https://www.weworkmeteor.com", "main": "", "engines": { "node": "= 4.5.0", "npm": "= 3.9.6" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "lint": "eslint .", "pretest": "npm run lint –silent" }, "repository": […]

Meteor:sortablejs方法不被调用

我有一个组件,当简化看起来像这样: import Sortable from 'react-sortablejs'; class App extends Component { constructor(props) { super(props); } updateItemOrder() { let items = this.props.items; items.forEach((item, index) => { console.log(item._id); console.log(index); updateItem.call({ _id: item._id, update: { priority: index } }); }); }; render() { <Sortable tag='ul' className='item-list list-group' onChange={ this.updateItemOrder() }> { this.renderItems() } </Sortable> } } 我的控制台在页面加载时列出了item._id和index ,但是当我将这些项目拖放到我的可sorting列表中时没有任何反应。 更改为<ReactSortable>组件也无济于事(按照文档 […]

如果从服务器(meteor)调用GET响应内容为空,

所以我想要做的是在Meteor服务器端使用标准的HTTP包parsing这个基于XML的RSS源。 混淆的是,如果从服务器调用,我收到一个空的内容响应,但如果我从客户端调用相同的端点,那么我会收到一个正常的XML内容。 我尝试从使用Meteor.call的客户端调用服务器方法,也试图用meteorshell调用它。 同样的结果 这是Meteor方法: readRssFeed: function() { try { HTTP.get("http://agenda.regiolive.ch/feed/", {}, function(error, response) { console.log(response) //parse xml }); } catch (error) { console.log(error); } }, 答复是: I20170514-15:20:06.474(3)? { statusCode: 200, I20170514-15:20:06.474(3)? content: '', I20170514-15:20:06.474(3)? headers: I20170514-15:20:06.474(3)? { date: 'Sun, 14 May 2017 12:12:04 GMT', I20170514-15:20:06.474(3)? server: 'Apache-Coyote/1.1', I20170514-15:20:06.474(3)? 'access-control-allow-origin': '*', I20170514-15:20:06.474(3)? 'content-type': 'application/xml;charset=UTF-8', I20170514-15:20:06.474(3)? […]

如何在Meteor + NodeJs应用程序中捕获未处理的exception

我们正在使用meteor+ NodeJS应用程序。 meteor应用程序用于客户端通信和Nodejs应用程序连接到数据库。 我们在meteor应用程序中给出了nodeJS应用程序引用。 当在nodejs应用程序中发生任何未处理的错误时,我们无法抓住它。 我们将meteor和nodejs应用程序作为一个包进行部署。 从meteor我们使用Meteor.wrapAsync(node.method1)调用nodejs方法。 我们可以捕捉meteor中的exception,直到从节点方法callback。 在callback之后,如果在nodejs方法中发生任何exception,我们将无法处理它。 感谢您的重播

meteor应用程序没有find“xhr-sync-worker.js”?

我正在尝试在meteor应用程序中运行一个deck.gl示例。 但是我正面临着这个错误。 modules-runtime.js?hash=8587d18…:231 Uncaught Error: Cannot find module './xhr-sync-worker.js' at makeMissingError (modules-runtime.js?hash=8587d18…:231) at Function.require.resolve (modules-runtime.js?hash=8587d18…:263) at xmlhttprequest.js (xml.js:30) at fileEvaluate (modules-runtime.js?hash=8587d18…:343) at require (modules-runtime.js?hash=8587d18…:238) at Window.js (xml.js:30) at fileEvaluate (modules-runtime.js?hash=8587d18…:343) at require (modules-runtime.js?hash=8587d18…:238) at api.js (xml.js:30) at fileEvaluate (modules-runtime.js?hash=8587d18…:343) 然而,所述js模块存在于meteor应用程序node_modules文件夹中。 /caseview/node_modules/jsdom/lib/jsdom/living/xhr-sync-worker.js 我怎样才能让我的应用程序看到它? 请注意,我不直接在我的代码中导入它,从上面的堆栈跟踪中可以看到。 也许这是一个meteor错误。

Mongodb – TypeError:ReplSetServers不是一个函数

我正在开发一个应用程序,它有MongoDB作为数据库。 我正在使用多个URL来连接MongoDB。 我用以下来连接数据库。 var mongoClient = require('mongodb').MongoClient; var Db = require('mongodb').Db; var Server = require('mongodb').Server; var ReplSetServers = require('mongodb').ReplSetServers; var replSet = new ReplSetServers([ new Server('localhost', 30000), new Server('localhost', 30001), new Server('localhost', 30002) ]); var db = new Db('machaao', replSet, {w:0}); 参考链接 通过使用require导入包后,我没有得到任何错误。 但使用new ReplSetServers我得到了以下错误。 TypeError: ReplSetServers is not a function 。 是否有任何我必须导入的依赖包? 还是应该在代码中进行更改? 我不知道为什么会出现这个错误。 […]

wkhtmltopdf:没有这样的文件或目录

我从以下代码安装了wkhtmltopdf sudo apt-get install wkhtmltopdf 但是当我创buildPDF时,它会产生以下错误 Error: /bin/bash: /usr/bin/wkhtmltopdf: No such file or directory

在mongodb中通过binDatatypes上传小文件

我想通过BinDatatypes将大小小于16MB的小file upload到MongoDB ,我知道这是小文件的唯一默认选项,而GRIDFS理想地用于超过16MB的文件。 不幸的是,我不能轻易得到正确的文档和上传文件的例子,没有在MongoDB文档上的GridFS。 我发现有关BinDatatypes的信息要么非常有限,要么我不明白。 通过几个类似的问题(主要是基于python的)和其他地方,我对BinData的使用有了一些想法,但仍然无法以这种方式成功上传文件。 我需要通过BinData上传文件的更多信息,特别是正确的方式来初始化,因为我通常得到的BinData not a function或BinData is not defined错误。 以下是我正在testingfunction的当前代码: import { Meteor } from "meteor/meteor"; import { Mongo } from "meteor/mongo"; export const Attachment = new Mongo.Collection("attachment"); let BinData = Mongo.BinData; //wrong initialisation function createAttachment(fileData) { const data = new Buffer(fileData, "base64"); Attachment.insert({file: new BinData(0, data)}); } 一些有用的链接: 蒙大的BSONtypes BSON规格

findOne在服务器上返回undefined

这是我在服务器上的代码: Meteor.publish('currentRequest', function (requestId) { console.log('from publish'); console.log(requestId) // The id is printed successfully console.log(Requests.findOne({_id: requestId})) // returns undefined return Requests.findOne({_id: requestId}); }); 项目ID被打印,但.findOne()似乎不工作,因为它返回undefined 。 我在这里做错了什么?

Buffer.swap16不是一个函数

我已经在NodeJS中testing了一些缓冲区交换function,但是在我的Meteor项目中它不起作用。 有人可以告诉我原因吗? 的NodeJS: var CRC = new Buffer([0x20,0x40]); console.log(CRC.swap16()); // OUTPUT: <Buffer 40 20> Meteor.js var CRC = new Buffer([0x20,0x40]); console.log(CRC.swap16()); // OUTPUT: TypeError: CRC.swap16 is not a function 有人可以帮我吗? 知道这可能是一个版本问题。 但目前我无法解决这个问题。 有没有办法让这个东西与meteor运行?