nodeclub 环境搭建记录

搭建nodeclub源码,准备学习一下。

项目地址

https://github.com/cnodejs/nodeclub

搭建步骤 按照说明步骤:

1. 安装 `Node.js/io.js[必须]` `MongoDB[必须]` `Redis[必须]`

  mac环境下采用brew来安装

brew install mongodb

==> Downloading https://homebrew.bintray.com/bottles/mongodb-3.2.4.yosemite.bott

######################################################################## 100.0%

==> Pouring mongodb-3.2.4.yosemite.bottle.tar.gz

==> Caveats

To have launchd start mongodb at login:

  mkdir -p ~/Library/LaunchAgents

  ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

Then to load mongodb now:

  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

Or, if you don't want/need launchctl, you can just run:

  mongod --config /usr/local/etc/mongod.conf

==> Summary

🍺  /usr/local/Cellar/mongodb/3.2.4: 17 files, 208.7M

  

2. 启动 MongoDB 和 Redis

  启动MongoDb

执行

mongod --config /usr/local/etc/mongod.conf

mongo

......

   redis-server

遇到的问题:

  1.执行mongod 卡着不动,再执行mongo命令时候提示

2016-05-09T15:05:42.632+0800 I CONTROL  [initandlisten] MongoDB starting : pid=867 port=27017 dbpath=/data/db 64-bit host=liudeMacBook-Air.local
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] db version v3.2.3
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] allocator: system
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] modules: none
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] build environment:
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten]     distarch: x86_64
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] options: {}
2016-05-09T15:05:42.633+0800 I STORAGE  [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

  解决 sudo 去创建 /data/db 文件夹

  2.强行关闭后再执行mongo会提示。。。。。mongo.lock.....

  解决 手动删除此文件 

  3.mac系统问题 执行su 提示 su:sorry

  解决:http://dev.son1c.com/show/1301.html 执行sudo su

 

3. `$ make install` 安装 Nodeclub 的依赖包

4. `cp config.default.js config.js` 请根据需要修改配置文件

5. `$ make test` 确保各项服务都正常

6. `$ node app.js`

7. visit `http://localhost:3000`

 

未解决问题:登陆账号现需要邮箱验证 但是debug不发邮件 无法登陆

 

 

posted on 2016-09-18 18:47  wjw334  阅读(619)  评论(0编辑  收藏  举报

导航