0
我在我的應用程序中使用serialport軟件包(https://github.com/voodootikigod/node-serialport)。 該代碼只是工作正常的服務器上:保存與流星的serialport列表
Meteor.startup(function() {
SerialPort = Meteor.npmRequire('serialport');
});
Meteor.methods({
serialPortsRefresh: function() {
SerialPort.list(function (err, ports) {
ports.forEach(function(port) {
console.log(port.comName);
});
// Config.insert(ports);
return ports;
});
}
});
現在我想保存集合,在此列表中它暴露給客戶端。 什麼是最佳解決方案?
當我取消註釋Config.insert(端口);我有錯誤:
throw new Error("Meteor code must always run within a Fiber. " +
在此先感謝!
嘗試。你會在文檔中找到它 –