javascript - meteor : "=> Exited with code: 8"错误

标签 javascript meteor meteorite meteor-blaze meteor-helper

刚刚开始使用 Meteor,按照 Discover Meteor 中提供的教程进行操作

实现第 3 章中的代码后,我不断收到以下错误:

W20150714-18:47:36.539(-7)? (STDERR)          
W20150714-18:47:36.540(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150714-18:47:36.540(-7)? (STDERR)                        throw(ex);
W20150714-18:47:36.540(-7)? (STDERR)                              ^
W20150714-18:47:36.541(-7)? (STDERR) TypeError: undefined is not a function
W20150714-18:47:36.541(-7)? (STDERR)     at app/collections/posts.js:1:44
W20150714-18:47:36.541(-7)? (STDERR)     at app/collections/posts.js:3:3
W20150714-18:47:36.541(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:222:10
W20150714-18:47:36.541(-7)? (STDERR)     at Array.forEach (native)
W20150714-18:47:36.541(-7)? (STDERR)     at Function._.each._.forEach (/Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150714-18:47:36.541(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
W20150714-18:47:38.256(-7)? (STDERR)          
W20150714-18:47:38.256(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150714-18:47:38.257(-7)? (STDERR)                        throw(ex);
W20150714-18:47:38.257(-7)? (STDERR)                              ^
W20150714-18:47:38.259(-7)? (STDERR) TypeError: undefined is not a function
W20150714-18:47:38.259(-7)? (STDERR)     at app/collections/posts.js:1:44
W20150714-18:47:38.259(-7)? (STDERR)     at app/collections/posts.js:3:3
W20150714-18:47:38.259(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:222:10
W20150714-18:47:38.259(-7)? (STDERR)     at Array.forEach (native)
W20150714-18:47:38.259(-7)? (STDERR)     at Function._.each._.forEach (/Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150714-18:47:38.259(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
W20150714-18:47:39.821(-7)? (STDERR)          
W20150714-18:47:39.822(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150714-18:47:39.822(-7)? (STDERR)                        throw(ex);
W20150714-18:47:39.822(-7)? (STDERR)                              ^
W20150714-18:47:39.824(-7)? (STDERR) TypeError: undefined is not a function
W20150714-18:47:39.825(-7)? (STDERR)     at app/collections/posts.js:1:44
W20150714-18:47:39.825(-7)? (STDERR)     at app/collections/posts.js:3:3
W20150714-18:47:39.825(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:222:10
W20150714-18:47:39.825(-7)? (STDERR)     at Array.forEach (native)
W20150714-18:47:39.825(-7)? (STDERR)     at Function._.each._.forEach (/Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150714-18:47:39.825(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
=> Modified -- restarting.
W20150714-18:53:37.467(-7)? (STDERR)          
W20150714-18:53:37.468(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150714-18:53:37.468(-7)? (STDERR)                        throw(ex);
W20150714-18:53:37.468(-7)? (STDERR)                              ^
W20150714-18:53:37.470(-7)? (STDERR) TypeError: undefined is not a function
W20150714-18:53:37.471(-7)? (STDERR)     at app/collections/posts.js:1:44
W20150714-18:53:37.471(-7)? (STDERR)     at app/collections/posts.js:3:3
W20150714-18:53:37.471(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:222:10
W20150714-18:53:37.471(-7)? (STDERR)     at Array.forEach (native)
W20150714-18:53:37.471(-7)? (STDERR)     at Function._.each._.forEach (/Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150714-18:53:37.471(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
=> Modified -- restarting.
=> Errors prevented startup:                  

   While building the application:
   client/views/posts/post_item.js:9:2: Unexpected token )

=> Your application has errors. Waiting for file change.
=> Modified -- restarting.                    
W20150714-18:56:52.185(-7)? (STDERR)          
W20150714-18:56:52.185(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150714-18:56:52.186(-7)? (STDERR)                        throw(ex);
W20150714-18:56:52.186(-7)? (STDERR)                              ^
W20150714-18:56:52.188(-7)? (STDERR) TypeError: undefined is not a function
W20150714-18:56:52.188(-7)? (STDERR)     at app/collections/posts.js:1:44
W20150714-18:56:52.188(-7)? (STDERR)     at app/collections/posts.js:3:3
W20150714-18:56:52.188(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:222:10
W20150714-18:56:52.188(-7)? (STDERR)     at Array.forEach (native)
W20150714-18:56:52.189(-7)? (STDERR)     at Function._.each._.forEach (/Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150714-18:56:52.189(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
W20150714-18:56:53.775(-7)? (STDERR)          
W20150714-18:56:53.775(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150714-18:56:53.775(-7)? (STDERR)                        throw(ex);
W20150714-18:56:53.775(-7)? (STDERR)                              ^
W20150714-18:56:53.778(-7)? (STDERR) TypeError: undefined is not a function
W20150714-18:56:53.778(-7)? (STDERR)     at app/collections/posts.js:1:44
W20150714-18:56:53.778(-7)? (STDERR)     at app/collections/posts.js:3:3
W20150714-18:56:53.778(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:222:10
W20150714-18:56:53.778(-7)? (STDERR)     at Array.forEach (native)
W20150714-18:56:53.778(-7)? (STDERR)     at Function._.each._.forEach (/Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150714-18:56:53.778(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
W20150714-18:56:55.400(-7)? (STDERR)          
W20150714-18:56:55.400(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150714-18:56:55.400(-7)? (STDERR)                        throw(ex);
W20150714-18:56:55.400(-7)? (STDERR)                              ^
W20150714-18:56:55.402(-7)? (STDERR) TypeError: undefined is not a function
W20150714-18:56:55.402(-7)? (STDERR)     at app/collections/posts.js:1:44
W20150714-18:56:55.402(-7)? (STDERR)     at app/collections/posts.js:3:3
W20150714-18:56:55.402(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:222:10
W20150714-18:56:55.403(-7)? (STDERR)     at Array.forEach (native)
W20150714-18:56:55.403(-7)? (STDERR)     at Function._.each._.forEach (/Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150714-18:56:55.403(-7)? (STDERR)     at /Users/TXC/code/microscope/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.

我不太明白这个错误,最重要的是,我不知道在哪里寻找解决问题的方法。

这是我的 JavaScript 文件: - posts_list.js

var postsData = [{
    title: 'Introducing Telescope',
    author: 'Sacha Greif',
    url: 'http://sachagreif.com/introducing-telescope/'
}, {
    title: 'Meteor',
    author: 'Tom Coleman',
    url: 'http://meteor.com/'
}, {
    title: 'The Meteor Book',
    author: 'Tom Coleman',
    url: 'http://themeteorbook.com/'
}];
if (Meteor.isClient) {
    Template.postsList.helpers({
        posts: postsData
    });
}

post_item.js

if (Meteor.isClient) {
    Template.postItem.helpers({
        domain: function(){
            var a = document.createElement('a');
            a.href = this.url;
            return a.hostname;
        }
    });
}

posts.js

Posts = new Meteor.collection('posts');

这是 html 模板:

posts_list.html

<template name="postsLists">
    <div class="posts">
        {{#each posts}}
            {{> postItem}}
        {{/each}}
    </div>
</template>

post_item.html

<template name="postItem">
    <div class="post">
        <div class="post-content">
            <h3><a href="{{url}}">{{title}}</a><span>{{domain}}</span></h3>
        </div>
    </div>
</template>

我是否遗漏了一些明显的东西?这是版本兼容性问题吗?还是某个地方有错误?

最佳答案

我认为您在 posts.js 中拼写错误:Mongo.Collection,它是大写的 C

关于javascript - meteor : "=> Exited with code: 8"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31420304/

相关文章:

javascript - Meteor.js - 我可以放入 Meteor shell 以在我的 Meteor 环境中尝试一些 JavaScript 吗?

meteor - 如何避免cursor.observe 上的竞争条件?

meteor - Deps 重新计算函数出现异常 : TypeError: Cannot read property 'option1' of undefined

node.js - meteor 主机上的 meteor 部署错误

javascript - Meteor 中的级联选择控件

javascript - 如何开发具有多个输出接口(interface)的Meteor JS应用程序?

javascript - removeEventListener - 函数定义本身内的回调?

javascript - 如何使用微数据提取/解析 HTML

javascript - 重新添加谷歌地图标记

javascript - 如何在 jQuery 的选择器中定义类似 OR 的东西?