Nodejs+mongodb+express built complete Nodejs website example

Source: Internet
Author: User
Tags install mongodb mongodb

A Nodejs community developed with Nodejs, nodeclub Open source, hence downloaded a good study, Github homepage:

Effect Chart:

first under the Mac:
Install MongoDB
Run the mongod underneath the bin
Ps:mongodb will default to the data file in/data/db, you need to build a directory, and the right to the current user

GUI Tools for installing MongoDB
Preview interface
Use git to download the Nodeclub source code, and then run
npm-d Install
CP Config.default.js Config.js
Modify the config file as yours
Node App.js

A complete Nodejs site on the set up, and then began to study the code slowly, while watching learning it ~

If you are under win:

or download MongoDB, set the path, start

Download GUI Tools Mongovue

Two questions that might come up in the back

1:window cannot be installed under Mongoose
Err! Unsupported
Err! Not compatible with your operating system or architecture: <a href= "Mailto:mongodb@0.9.9-7" >mongodb@0.9.9-7</a >
Err! Valid os:linux,darwin,freebsd,sunos,windows
Err! Valid Arch:any
Err! Actual Os:win32
Err! Actual Arch:ia32

Solution Method:

Download a mongoose, put it under% of your item%node_modules, and then execute npm-d in Mongoose directory install

2: After registering the user, login error cannot use ' in ' operator to search for ' minimize ' in user
Typeerror:cannot use ' in ' operator to search for ' minimize ' in user
At (native)
At Model.toobject (f:nodejsnodeclubnode_modulesmongooselibdocument.js:1159:19)
At Model.tojson (f:nodejsnodeclubnode_modulesmongooselibdocument.js:1229:15)
At object.stringify (native)
At array.0 (f:nodejsnodeclubnode_modulesexpressnode_modulesconnectlibmiddlewaresessionmemory.js:74:31)
At Eventemitter._tickcallback (node.js:192:40)

Solution: Transmission Door

Modify the node_modulesmongooselibdocument.js below
if (!options) {

if (!) ( Options &amp;&amp; ' Object ' = = {

It's OK.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.