即使在重新安装后,Meteor也会不断崩溃



我试图在本地主机上运行我的项目,但每当我尝试它崩溃时。我甚至试着把它直接部署到流星网站上,但什么也没发生。这一切都发生得很突然。一切都很正常,直到我添加了"tap:i18n"one_answers"accounts-facebook"包。

    /Users/haraldur/.meteor/packages/meteor-tool/.1.1.9.1sd3e7j++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
                    throw(ex);
                          ^ReferenceError: ServiceConfiguration is not defined
at lib/app.js:29:1
at /Users/haraldur/myapp/.meteor/local/build/programs/server/app/lib/app.js:47:4
at /Users/haraldur/myapp/.meteor/local/build/programs/server/boot.js:242:10
at Array.forEach (native)
at Function._.each._.forEach (/Users/haraldur/.meteor/packages/meteor-tool/.1.1.9.1sd3e7j++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
at /Users/haraldur/myapp/.meteor/local/build/programs/server/boot.js:137:5

退出代码:8应用程序正在崩溃。等待文件更改

这是我的app.js文件。我甚至没有写第47行。我很困惑。

Timeouts = {};
// Initialize my collections
Rooms = new Meteor.Collection("rooms");
Videos = new Meteor.Collection("videos");
Messages = new Meteor.Collection("messages");
Votes = new Meteor.Collection("votes");
Favorites = new Meteor.Collection("favorites");
Skips = new Meteor.Collection("skips");
Cache = {};
Cache.Spotify = new Meteor.Collection("cache_spotify");
Cache.YouTube = new Meteor.Collection("cache_youtube");
Cache.Echonest = new Meteor.Collection("cache_echonest");
Cache.Freebase = new Meteor.Collection("cache_freebase");
// Dependencies for YouTube player
youtubeApiReady = false;
youtubePlayerReady = false;
youtubeApiDependency = new Deps.Dependency;
youtubePlayerDependency = new Deps.Dependency;
onYouTubeIframeAPIReady = function(){
    youtubeApiReady = true;
    youtubeApiDependency.changed();
}
ServiceConfiguration.configurations.remove({
  service: "twitter"
});
ServiceConfiguration.configurations.insert({
  service: "twitter",
  consumerKey: APIKeys.twitter.consumerKey,
  secret: APIKeys.twitter.secret
});

看起来accounts-facebook包需要特定的配置

尝试添加service-configuration到您的应用程序

meteor add service-configuration
参考https://atmospherejs.com/meteor/service-configuration

既然添加这两个包似乎是罪魁祸首,请尝试一次删除一个。首先:

meteor remove tap:i18n

试着运行它。如果仍然失败,尝试:

meteor remove accounts-facebook

…然后再试一次。

或者首先,您可能想看看这两个位置的内容:

lib/app.js:29:1
lib/app.js:47:4

瞧,app.js文件的第29行第1字符和第47行第4字符是什么。也许这里有问题,但如果它在添加这两个包之前工作,则可能没有问题。

最新更新