fbpx

Series: Introduction to the MEAN Stack

In this article, we will lay out the basics for our later web application by installing Node.js and MongoDB. Here we go!

Installing Node.js

The installation of Node.js is very simple. On the home page of the Node.js project at http://nodejs.org/ there is an installation link, which leads to the installation file for the current operating system.

Download Node.js

At the time of writing, the latest version of Node.js is v0.10.18. After downloading the installation file, you must open it and then follow the installation steps. In the terminal, you can now test whether the installation was successful:

1
2
$ node  v
> v0.10.8

Installation of MongoDB

The installation of MongoDB is somewhat more complex than with Node.js. The Package Manager Homebrew  can be used to make it easier on Mac OS X. This step is not necessary, but Homebrew not only facilitates the installation of MongoDB but also other programs, making it a useful tool for Mac OS X developers.

Homebrew needs the Xcode software from Apple, which many Mac OS X developers have already installed. If not, this can be easily done through the App Store:

Download Xcode

Homebrew is then installed with the following command:

1
$ ruby  e “$ (curl -fsSL https://raw.github.com/mxcl/homebrew/go)”

The installation must be confirmed with ⌘ and, if necessary, the user password.

After the installation, Homebrew must be initialized with the following command:

1
$ brew doctor

Now MongoDB can be installed with the following command:

1
$ brew install mongodb

The latest version of MongoDB is at the time of writing 2.4. Whether the installation was successful can be tested via the terminal:

1
2
$ mongo  version
> MongoDB shell version: 2.4.6

The installation of MongoDB seems a bit complicated by Xcode and Homebrew, but these are unique steps and many developers have already pre-installed Homebrew. In this case the installation over a single command line would have been very fast. In the future, new MongoDB versions can be easily installed via Homebrew.

You have now installed Node and MongoDB. In the next articles, we will devote ourselves to Node before I tell you MongoDB.

Categories: Tutorials

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.