1
我正在使用流星,使用打字稿es6的angular2,而我在为异步功能编写流星法时遇到了这个错误。我在插入查询中遇到同步问题,因为当名称相同时,它在插入时不提供给我一个错误。所以我决定使用光纤和未来,但打字稿不断给我一个错误,它无法找到纤维/未来的模块。 我试图 流星NPM安装光纤, 流星NPM安装的将来, 流星添加ostrio:[email protected] 但没有什么工作。如果有任何解决方案,请告诉我。如果有任何其他方法可以用来解决这个问题,请告诉我。流星:在打字稿中写流星法时找不到模块光纤/未来
import { Emails } from '../collections/emails.collection';
import { check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';
import Future from 'fibers/future';
Meteor.methods({
loadEmailTemp: function(tempn: string){
let temp = Emails.findOne({tempname: tempn});
return temp;
},
getAllTemplates: function() {
let temps = Emails.find({}).fetch();
return temps;
},
newTemplate: function(tempn: string) {
let err = false;
let result = Emails.insert({
tempname: tempn,
subject: '',
text: ''
}, function(error, result){
if(error){
console.log("ERROR",error);
err = true;
}
if(result) console.log("RESULT",result);
});
return result;
}
});
我的错误是
W20161203-13:15:44.055(5.5)? (STDERR) /Users/exMachina/.meteor/packages/meteor-tool/.1.4.2_1.1ulueqv++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20161203-13:15:44.056(5.5)? (STDERR) throw(ex);
W20161203-13:15:44.056(5.5)? (STDERR) ^
W20161203-13:15:44.057(5.5)? (STDERR)
W20161203-13:15:44.057(5.5)? (STDERR) Error: Cannot find module 'fibers'
W20161203-13:15:44.058(5.5)? (STDERR) at Function.Module._resolveFilename (module.js:325:15)
W20161203-13:15:44.058(5.5)? (STDERR) at Function.Module._load (module.js:276:25)
W20161203-13:15:44.058(5.5)? (STDERR) at Module.require (module.js:353:17)
W20161203-13:15:44.059(5.5)? (STDERR) at require (internal/module.js:12:17)
W20161203-13:15:44.059(5.5)? (STDERR) at Object.<anonymous> (/Users/exMachina/.meteor/packages/ostrio_neo4jdriver/.1.0.2.1tve9ie++os+web.browser+web.cordova/npm/node_modules/neo4j-fiber/lib/helpers.js:33:11)
W20161203-13:15:44.059(5.5)? (STDERR) at Object.<anonymous> (/Users/exMachina/.meteor/packages/ostrio_neo4jdriver/.1.0.2.1tve9ie++os+web.browser+web.cordova/npm/node_modules/neo4j-fiber/lib/helpers.js:62:4)
W20161203-13:15:44.060(5.5)? (STDERR) at Module._compile (module.js:409:26)
W20161203-13:15:44.060(5.5)? (STDERR) at Object.Module._extensions..js (module.js:416:10)
W20161203-13:15:44.067(5.5)? (STDERR) at Module.load (module.js:343:32)
W20161203-13:15:44.067(5.5)? (STDERR) at Function.Module._load (module.js:300:12)