NodeJS in 5 minutes

Download Mac Installer

Install and note that node was installed at


npm (Node Package Manager)  was installed at

Make sure that /usr/local/bin is in your $PATH.

echo $PATH

Use npm to install node.js packages. This will install package XYZ in current directory

npm install XYZ

This will install package XYZ globally

npm install -g XYZ

Install driver/mapping for MongoDB

npm install mongoose

install rest library

npm install restify

Put your .js files in a Site directory and run them:

node myserver.js

Here is an example from the Node site

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '');
console.log('Server running at');

save this file in your Sites directory as example.js and run the node server

node example.js

Now open the path to the server in a browser


MongoDb in 5 minutes

Download and Install MongoDB (using 2.0 64bit stable at the moment)

Copy unzipped directory anywhere (I have it in ~/mongodb-osx-x86_64-2.0.5)

Before you start mongod for the first time, you will need to create the data directory. By default, mongod writes data to the /data/db/ directory. To create this directory, and set the appropriate permissions use the following commands:

sudo mkdir -p /data/db
sudo chown `id -u` /data/db

Run MongoDB Server in one terminal windo


Run MongoDB Client in another