2015-07-13 128 views
0

我一直在尝试使用下面的教程安装MEAN堆栈:问题安装MEAN堆栈

http://www.bossable.com/303/install-mean-stack/#comment-1526

我使用webstorm和MongoDB。

但是我一直没有成功,我不断收到错误。每当我连接到本地主机:3000我得到以下错误:

C:\meanproject>grunt 
    Running "jshint:all" (jshint) task 
    >> 55 files lint free. 

    Running "csslint:all" (csslint) task 
    >> 2 files lint free. 

    Running "concurrent:default" (concurrent) task 
    Running "nodemon:dev" (nodemon) task 
    Running "watch" task 
    Waiting... 
    [nodemon] v1.2.1 
    [nodemon] to restart at any time, enter `rs` 
    [nodemon] watching: app/views/**/*.* gruntfile.js server.js   config/**/*.js app/* 
    */*.js 
    [nodemon] starting `node --debug server.js` 
    Debugger listening on port 5858 
    Application loaded using the "development" environment configuration 
    { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } 

    js-bson: Failed to load c++ bson extension, using pure JS version 
    { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } 

    js-bson: Failed to load c++ bson extension, using pure JS version 
    MEAN.JS application started on port 3000 
    C:\meanproject\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection 
    \base.js:246 
    throw message; 
     ^
Error: Error setting TTL index on collection : sessions 
at C:\meanproject\node_modules\connect-mongo\lib\connect-mongo.js:169:23 
at C:\meanproject\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db. 
js:1499:46 
at C:\meanproject\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db. 
js:1632:20 
at C:\meanproject\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cur 
sor.js:170:22 
at C:\meanproject\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cur 
    sor.js:714:39 
    at Cursor.close (C:\meanproject\node_modules\mongoose\node_modules\mongodb\l 
ib\mongodb\cursor.js:1009:5) 
at commandHandler (C:\meanproject\node_modules\mongoose\node_modules\mongodb 
    \lib\mongodb\cursor.js:714:21) 
    at C:\meanproject\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db. 
    js:1905:9 
    at Server.Base._callHandler (C:\meanproject\node_modules\mongoose\node_modul 
    es\mongodb\lib\mongodb\connection\base.js:453:41) 
    at C:\meanproject\node_modules\mongoose\node_modules\mongodb\lib\mongodb\con 
    nection\server.js:488:18 
    at MongoReply.parseBody (C:\meanproject\node_modules\mongoose\node_modules\m 
    ongodb\lib\mongodb\responses\mongo_reply.js:68:5) 
    at null.<anonymous> (C:\meanproject\node_modules\mongoose\node_modules\mongo 
db\lib\mongodb\connection\server.js:446:20) 
at emit (events.js:107:17) 
at null.<anonymous> (C:\meanproject\node_modules\mongoose\node_modules\mongo 
db\lib\mongodb\connection\connection_pool.js:207:13) 
at emit (events.js:110:17) 
at Socket.<anonymous> (C:\meanproject\node_modules\mongoose\node_modules\mon 
godb\lib\mongodb\connection\connection.js:440:22) 
    [nodemon] app crashed - waiting for file changes before starting... 

我该如何去解决这个问题?

+0

检查您的mongod服务是否正在运行。 – harilalkm

回答

1

您需要先运行mongodb.exe文件。成功启动mongodb后,您需要导航到您的项目文件夹并运行“grunt”。如果它显示了一个未找到的模块的错误列表,则需要使用npm全局安装这些模块。这将为你解决问题。但请注意,bossable.com教程是针对0.3平均锅炉板厚度的。他们现在将版本升级到0.4.1。请按照Meanjs documentation 获取最新信息。