A few weeks ago I introduced MEAN.JS, which is a modern Stack based on Node.

This post will be covering the installation process, since you have to start at the beginning :)

First, to make sure we have all the prerequisites:

  • node.js - this is the server, the replacement for Apache if you will.

  • npm - Node Package Manager, makes it easy to install packages that use node (like express, socket.io etc.) All the npm install commands might require a "sudo".

  • mongoDB - the Database, it’s NoSQL. If you’ve only used SQL databases, think of it as JSON objects inside documents (don’t worry, it makes sense - I swear). MongoDB has to run, otherwise you’ll get an error on the final step some notes about possible errors when running MongoDB:

    • Make sure you create the /data/db/ directory (that’s the path for linux anyways)

      sudo mkdir -p /data/db/
      sudo chown `id -u` /data/db
    • Remember, mongodb is a service, if you want to run it via terminal (I like it because you can see the logs live), run

      sudo service mongodb stop
      sudo mongod
    • Tip - I recommend using Robomongo for taking care of the database, this GUI tool is Shell-centric, and I think that in order to better understand MongoDB - it’s crucial to know which commands are being called. Definitely the best way to learn. You can use Robomongo to make sure you create the Collection (=Database in MongoDB) that your app is configured to use. For the development environment it’ll be APPNAME-dev.

  • bower:

    npm install -g bower

    Package manager for the web, think of it as npm for front end stuff (like CSS frameworks, or front end JS frameworks)

And finally

  • MEAN.JS: Use Yeoman Generator, it’s fast and an awesome tool to learn to use anyway.

     npm install -g yo 

    after Yeoman is installed, you need to install the MEAN.JS generator:

    npm install -g generator-meanjs 

    then simply write

    yo meanjs

    You should get some prompt that asks you what your app is called and what-not, then finish with an epic sequence of libraries installation. Now run


After what seems like an installation of every library known to man, you should finally see something like this:

MeanJS Installed

You can check out some built-in functions to make sure everything works.

Try to Signup, if that doesn’t work make sure you have everything for MongoDB configured correctly. The connection string is at config/env/development.js (for the development environment).

I’ll try to take a deeper look at how the different parts play together, and what does MeanJS give you when starting to build a web app.

I highly recommend for people trying to figure this stack out, to check out the Folder Structure, which is very clearly described in the Docs.

Until next week!